S
SEC
Data Format Returned: T
SEC returns the numeric seconds portion of a date/time field.
SelectAlias(expC)
Data Format Returned: R
Does
not return a display value, but useful in reports to manually make a different
work area the active (selected) work area. By default, reports generate
based on the active alias. Be aware that if this function is used to change
the active work area, it should subsequently be restored to its original
status or report results may become unpredictable. Returns true (.T.
) if select is successful, false (.F.
) if requested alias name is not in use.
Parameters
Variable | Status | Description |
---|---|---|
expC | Required | Name of alias to select. Must be in use. |
SkipInAlias(expC,expN)
Data Format Returned: R
Does
not return a display value, but useful in reports to manually move the
record pointer in an alias. When reports are generated, the record pointer
is automatically moved in the reports primary alias (query). To manually
advance the record pointer in sub-queries, place this function in an expression
box in the appropriate position on the report. The function will return
a logical true (.T.
) if the record pointer
was successfully moved, or a false (.F.
)
if an attempt was made to advance the record pointer past the last or
first record in the file.
Parameters
Variable | Status | Description |
---|---|---|
expC | Optional | Name of alias in which to move record pointer. If not passed, currently selected alias is assumed. |
expN | Optional | Direction and number of records to move forward or backward. A negative number assumes backward movement. If not passed, record pointer is moved forward to the next record. |
SQLAvg(expC1,expC2,expC3)
Data Format Returned: R
Performs an SQL sub-select query and returns the average value in a numeric field or expression.
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | Name of field or expression containing values to average. |
expC2 | Optional | Filter expression used to qualify records. If not passed, all records are included in the average |
expC3 | Optional | Name of alias or table name containing the values to average. If not passed, currently selected alias is assumed. This can be the name of an alias already in use, or can point to a physical table name, in which case the alias name does not have to be in use. |
SQLCnt(expC1,expC2,expL,expC3)
Data Format Returned: X
Performs an SQL sub-select query to count the number of values in a field. The field can contain any type of data with the exception of memo (notes or narratives). Only field names are valid (i.e. no complex expressions).
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Optional | Name of field containing values to count. If not passed, a simple count of records is returned. |
expC2 | Optional | Filter expression used to qualify records. If not passed, all records are included in the counted |
expL | Optional | If passed as
true (.T. ), only distinct (unique) values
are counted. If false (.F. ), all values are
counted. If not passed, false is assumed. If passed as true, field name
(expC1) must be specified.
|
expC3 | Optional | Name of alias or table name containing the field to count. If not passed, currently selected alias is assumed. This can be the name of an alias already in use, or can point to a physical table name, in which case the alias name does not have to be in use. |
SQLMax(expC1,expC2,expC3)
Data Format Returned: X
Performs an SQL sub-select query and returns the maximum value in a field or expression. The field or expression can contain any type of data with the exception of memo (notes or narratives).
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | Name of field or expression containing values to compare. |
expC2 | Optional | Filter expression used to qualify records. If not passed, all records are included in the comparison |
expC3 | Optional | Name of alias or table name containing the values to compare. If not passed, currently selected alias is assumed. This can be the name of an alias already in use, or can point to a physical table name, in which case the alias name does not have to be in use. |
SQLMin(expC1,expC2,expC3)
Data Format Returned: X
Performs an SQL sub-select query and returns the minimum value in a field or expression. The field or expression can contain any type of data with the exception of memo (notes or narratives).
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | Name of field or expression containing values to compare. |
expC2 | Optional | Filter expression used to qualify records. If not passed, all records are included in the comparison |
expC3 | Optional | Name of alias or table name containing the values to compare. If not passed, currently selected alias is assumed. This can be the name of an alias already in use, or can point to a physical table name, in which case the alias name does not have to be in use. |
SQLSum(expC1,expC2,expC3)
Data Format Returned: X
Performs an SQL sub-select query to sum the numeric value of a field or expression.
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | Name of field or expression containing values to sum. |
expC2 | Optional | Filter expression used to qualify records. If not passed, all records are included in the sum |
expC3 | Optional | Name of alias or table name containing the values to sum. If not passed, currently selected alias is assumed. This can be the name of an alias already in use, or can point to a physical table name, in which case the alias name does not have to be in use. |
SQLValue(expC1,expC2,expN)
Data Format Returned: X
Performs
an SQL sub-select query and returns a value or list of values from that
query. The value returned is cExp2 from each record in the result
set. If cExp2 is not passed, the function assumes the first field.
If the query passed returns a single record, the data type of the value
returned will match the data type from the result set. If multiple records
are returned, the value returned will be a string of values, each terminated
with a CR/LF
.
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | SQL select statement to execute. |
expC2 | Optional | Expression to return. If not passed, the value of the first field in the result set is returned. |
expN | Optional | Maximum number of records (values/lines) to return. If passed as zero or not passed, all records are assumed. |
StaffHours(expC1,expC2)
Data Format Returned: X
Returns the total staff hours for different types of items.
- FIRE: Combined total hours for all responding personnel.
- MEDIC: Combined total hours for all responding personnel.
- ACTIV: Combined total hours for all participants.
- OCCUP: Contents of the staff hours field in the inspection record.
- MAINT: Contents of the staff hours field in the maintenance record.
- HYDR: Contents of the staff hours field in the hydrant activity record.
- EVENT: Contents of the staff hours field in the event record.
- TRAIN: Combined total hours for all attendees.
These items can now have an associated activity you
may want to use a type of ACTIV
with the key value from the records ACTIV_ID
field instead of using the staff hours field of these items. This
will allow you to track multiple staff assigned to these items more easily.
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Required | Type of item to get hours for (See description for valid types). |
expC2 | Required | Key value to get hours for. |
StaffHours('FIRE',Type.Inci_id)
would show
the total staff hours for a given incident if added exactly as is to the
Incident Type Report
.
StaffHours(‘OCCUP’,Insp.insp_id)
returns
the hours work for each inspection returned
StaffHours('ACTIV',Act_staff_id.Activ_id)
returns a total amount of staff hours for each activity returned.
StaffName(expC1,expL1,expC2,expL2)
Data Format Returned: X
Returns a formatted name for a staff member by ID or in a specified alias. If no parameters are passed, Last + First + Middle is assumed for the current alias. If expC1 is blank, No Staff ID is returned.
Parameters
Variable | Status | Description |
---|---|---|
expC1 | Optional | Staff ID or alias name (is the current alias). |
expL1 | Optional | Include Rank in the return value. |
expC2 | Optional | Formatting can be LFM, FML, or an expression. |
expL2 | Optional | If .T. ,
then expC1 is an alias,
and not a staff ID. |
StationAddress(expV,expL)
Data Format Returned: R
Returns the street address of a station from the lookup database.
Parameters
Variable | Status | Description |
---|---|---|
expV | Required | Station to return address for. This can
be a character value or a logical value. If this is a logical value and
is passed as true (.T. ), the address returned
is the address of the central station for this department. If a code is
passed (character value), the returned address is for the station designated
by that code. If nothing is passed, the address of the default station
for this workstation is returned. |
expL | Optional | If passed as true, address is returned on a single line. If passed as false, or not passed, address is multi-line. |
StationEMailList(expV,expN,expL)
Data Format Returned: R
Returns a muli-line list of email addresses for a specific station from the lookup database.
Parameters
Variable | Status | Description |
---|---|---|
expV | Required | Station to return email addresses for. This
can be a character value or a logical value. If this is a logical value
and is passed as true (.T. ), the email returned
is for the central station for this department. If a code is passed (character
value), the returned email is for the station designated by that code.
If nothing is passed, the email of the default station for this workstation
is returned.
|
expN | Optional | Maximum number
of email addresses to return. If not passed, all email addresses are assumed.
If passed as 1 or true (.T. ) only the default
email address is returned.
|
expL | Optional | If passed as true, a heading line is generated at the top of the list. |
StationEMailList(‘6-1’)
returns
all email addresses listed in the Code
for Stations form under Administrative
Options for station code 6-1.
StationEMailList(.t.)
returns all email
addresses for the station that is listed as the central station.
StationEMailList()
returns all email for the
station listed in Workstation Options, This Workstation is physically located at field.
StationName(expV)
Data Format Returned:R
Returns the name (description) of a station from the lookup database.
Parameters
Variable | Status | Description |
---|---|---|
expV | Required | Station to return name for. This can be
a character value or a logical value. If this is a logical value and is
passed as true (.T. ), the name returned is
the name of the central station for this department. If a code is passed
(character value), the returned name is for the station designated by
that code. If nothing is passed, the name of the default station for this
workstation is returned. |
StationName(6-1)
returns the Description (name)
for the station code 6-1. In
FIREHOUSE Software Demodata, that description is “Main Station”.
StationPhoneList(expV,expC1,expC2,expN,expL)
Data Format Returned: R
Returns a muli-line list of phone numbers for a specific station from the lookup database.
Parameters
Variable | Status | Description |
---|---|---|
expV | Required | Station to return phones for. This can be
a character value or a logical value. If this is a logical value and is
passed as true (.T. ), the phones returned
are for the central station for this department. If a code is passed (character
value), the returned phones are for the station designated by that code.
If nothing is passed, the phones of the default station for this workstation
are returned.
|
expC1 | Optional | Phone number type qualifier (e.g. HOME, WORK, FAX, etc...). If specified, only phone numbers matching the specified type are returned. |
expC2 | Optional | Expression
to return for each phone number found. If not passed, CODE + PHONE + EXTENSION
is assumed.
|
expN | Optional | Maximum number of phone numbers to return. If not passed, all phone numbers (matching type expC2 if specified) are assumed. |
expL | Optional | If passed as true, a heading line will be generated at the top of the list. If a custom return expression is passed, this parameter is ignored as the headings may be irrelevant. |
StationPhoneList(‘6-1’)
returns all phone
numbers listed in the “Code for Stations” form under the Administrative
options for Demodata station code 6-1.
StationPhoneList(.t.)
returns all phone
numbers for the station that is listed as the central station.
StationPhoneList()
returns all phone numbers
for the station listed in Workstation
Options in the This Workststion
is physically located at field.
STR(expN [, nLength [, nDecimalPlaces]])
Data Format Returned: Character
Returns the character equivalent of a specified numeric expression.
Parameters
Variable | Description |
---|---|
expN | Specifies the numeric expression STR( ) evaluates. |
nLength |
Specifies the length of the character string
If expN is of numeric or float type, If nLength isn’t included, the length of the character string defaults to 10 characters. |
nDecimalPlaces |
Specifies the number of decimal places in the character string If you specify fewer decimal places than are in expN, the return value is rounded. If nDecimalPlaces isn’t included, the number of decimal places defaults to zero. |
SUBSTR(expC, nStartPosition [, nCharactersReturned])
Data Format Returned: Character
Returns a character string from the given character expression or memo field.
SUBSTR( )
returns a character string from
a character expression or memo field, starting at a specified position
in the character expression or memo field and continuing for a specified
number of characters.
When using SUBSTR( )
with memo fields in
a SELECT – SQL
command, include the PADR( )
function in SUBSTR( )
so that empty or variable
length memo fields produce consistent results when converted to character
strings.
Parameters
Variable | Description |
---|---|
expC | Specifies the character expression or memo field from which the character string is returned. |
nStartPosition | Specifies the position in the character expression or memo field expC from where the character string is returned. The first character of expC is position 1. |
nCharactersReturned | Specifies the number of characters to return from expC. If you omit nCharactersReturned, characters are returned until the end of the character expression is reached. |