R/G Special Functions

Windows XP ¢ Report Generator V1.00 Functions and Their Uses:

+  Adds two numeric fields or concatenates two string fields.

Syntax:

Number1 + Number2

String1 + String2

Examples:

1 + 2 (returns 3)

ōABö + ōCDö (returns ōABCDö)

-  Subtracts two numeric fields.

Syntax:

Number1 - Number2

Examples:

4 - 1 (returns 3)

*  Multiplies two numeric fields.

Syntax:

Number1 * Number2

Examples:

4 * 2 (returns 8)

/  Divides two numeric fields.

Syntax:

Number1 / Number2

Examples:

10 / 2 (returns 5)

^  Raises to the power.

Syntax:

Number1 ^ Number2

Examples:

10 ^ 2 (returns 100)

=  If two values are equal returns 1; otherwise, returns 0.

Syntax:

Expression1 = Expression2

Examples:

4 = 4 (returns 1)

5 = 4 (returns 0)

ōAö = ōAö (returns 1)

ōAö = ōBö (returns 0)

<  If the first value is less the second value returns 1; otherwise, returns 0.

Syntax:

Expression1 < Expression2

Examples:

3 < 4 (returns 1)

4 < 4 (returns 0)

ōAö < ōBö (returns 1)

ōAö < ōAö (returns 0)

>  If the first value is greater the second value returns 1; otherwise, returns 0.

Syntax:

Expression1 > Expression2

Examples:

5 > 4 (returns 1)

4 > 4 (returns 0)

ōBö > ōAö (returns 1)

ōAö > ōAö (returns 0)

<>  If the first value is not equal to the second value returns 1; otherwise, returns 0.

Syntax:

Expression1 <> Expression2

Examples:

5 <> 4 (returns 1)

4 <> 4 (returns 0)

ōBö <> ōAö (returns 1)

ōAö <> ōAö (returns 0)

<=  If the first value is less than or equal to the second value returns 1; otherwise, returns 0.

Syntax:

Expression1 <= Expression2

Examples:

3 <= 4 (returns 1)

4 <= 4 (returns 1)

5 <= 4 (returns 0)

ōAö <= ōBö (returns 1)

ōAö <= ōAö (returns 1)

ōBö <= ōAö (returns 0)

>=  If the first value is greater than or equal to the second value returns 1; otherwise, returns 0.

Syntax:

Expression1 >= Expression2

Examples:

4 >= 4 (returns 1)

5 >= 4 (returns 1)

3 >= 4 (returns 0)

ōAö >= ōAö (returns 1)

ōBö >= ōAö (returns 1)

ōAö >= ōBö (returns 0)

AND (Equation)  If the equation to the left is true and the equation to the right is true returns 1; otherwise, returns 0.

Syntax:

Equation1 AND Equation2

Examples:

( 5 > 4 ) AND ( 4 = 4 ) (returns 1)

( 4 > 4 ) AND ( 4 = 4 ) (returns 0)

( 4 > 4 ) AND ( 3 = 4 ) (returns 0)

AND (Numeric)  Performs a logical AND on the bits of two numbers.

Syntax:

Number1 AND Number2

Examples:

3 AND 7 (returns 3)

3 AND 4 (returns 0)

OR (Equation)  If the equation to the left is true or the equation to the right is true returns 1; otherwise, returns 0.

Syntax:

Equation1 OR Equation2

Examples:

( 5 > 4 ) OR ( 4 = 4 ) (returns 1)

( 4 > 4 ) OR ( 4 = 4 ) (returns 1)

( 4 > 4 ) OR ( 3 = 4 ) (returns 0)

OR (Numeric)  Performs a logical OR on the bits of two numbers.

Syntax:

Number1 OR Number2

Examples:

3 OR 7 (returns 7)

3 OR 4 (returns 7)

ABS(  Returns the absolute (positive) value.

Syntax:

ABS(Number1)

Examples:

ABS( -7 ) (returns 7)

ABS( 7 ) (returns 7)

INT(  Returns the integer.

Syntax:

INT(Number1)

Examples:

INT( 7.025 ) (returns 7)

INT( 7 ) (returns 7)

SGN(  Returns the Sign (-1, 0, or +1).

Syntax:

SGN(Number1)

Examples:

SGN( -7 ) (returns -1)

SGN( 0 ) (returns 0)

SGN( 7 ) (returns 1)

CHR(  Returns the printable character of the number specified (1-255).

Syntax:

CHR(Number1)

Examples:

CHR( 65 ) (returns ōAö)

CHR( 122 ) (returns ōzö)

VAL(  Returns the numeric value of a string expression.

Syntax:

VAL(String1)

Examples:

VAL( ō65ö ) (returns 65)

STR(  Returns the string expression of a number.

Syntax:

STR(Number1)

Examples:

STR( 65 ) (returns ō65ö)

LEFT(  Returns the leftmost characters of a string.

Syntax:

LEFT(String1, Number1)

Examples:

LEFT( ōABCDEFö , 2 ) (returns ōABö)

RIGHT(  Returns the rightmost characters of a string.

Syntax:

RIGHT(String1, Number1)

Examples:

RIGHT( ōABCDEFö , 2 ) (returns ōEFö)

MID(  Returns the specified middle characters of a string.

Syntax:

MID(String1, Number1, Number2(optional))

Examples:

MID( ōABCDEFö , 2 , 3 ) (returns ōBCDö)

MID( ōABCDEFö , 3 ) (returns ōCDEFö)

TRIM(  Trims all leading and trailing spaces from a string.

Syntax:

TRIM(String1)

Examples:

TRIM( ō ABCDEF ö ) (returns ōABCDEFö)

RTRIM(  Trims all trailing spaces from a string.

Syntax:

RTRIM(String1)

Examples:

RTRIM( ō ABCDEF ö ) (returns ō ABCDEFö)

LTRIM(  Trims all leading spaces from a string.

Syntax:

LTRIM(String1)

Examples:

LTRIM( ō ABCDEF ö ) (returns ōABCDEF ö)

UCASE(  Converts all lower case characters to upper case.

Syntax:

UCASE(String1)

Examples:

UCASE ( ōabcdef123ABCö ) (returns ōABCDEF123ABCö )

FLIP(  Flips the string at the first comma.

Syntax:

FLIP(String1, Number1)   (Number1 indicates whether or not to flip 1=Flip, 0=NoFlip)

Examples:

FLIP( ōSmith, John M.ö, 1 ) (returns ōJohn M. Smithö )

FLIP( ōWidgets, Inc.ö, 0 ) (returns ōWidgets, Inc.ö )

INSTR(  Returns the location in a string where a second string can be found.

Syntax:

INSTR(String1, String2)

Examples:

INSTR( ōABCDEFö, ōCDEö ) (returns 3)

INSTR( ōCDEö , ōABCDEFö ) (returns 0)

DAYSBETWEEN(  Returns the number of days between two dates.

Syntax:

DAYSBETWEEN(String1, String2)

Examples:

DAYSBETWEEN(ō19980501ö, ō19980510ö) (returns 9)

ADATE(  Returns the 3-character month, 2-digit day, comma, and 4-digit year.

Syntax:

Examples:

ADATE( ō19980205ö ) (returns ōFeb 5, 1998ö)

FDATE(  Returns mm/dd/yyyy.

Syntax:

FDATE(String1)

Examples:

FDATE( ō19980205ö ) (returns ō02/05/1998ö)

LDATE(  Returns the alpha month, 2-digit day, comma, and 4-digit year.

Syntax:

LDATE(String1)

Examples:

LDATE( ō19980205ö ) (returns ōFebruary 5, 1998ö)

FTIME(  Returns hh:mm:ss am/pm.

Syntax:

FTIME(String1)

Examples:

FTIME( ō13:05:10ö ) (returns ō1:05:10 pmö)

MTIME(  Returns hh:mm.

Syntax:

MTIME(String1)

Examples:

MTIME( ō13:05:10ö ) (returns ō13:05ö)

STIME(  Returns hh:mm am/pm.

Syntax:

STIME(String1)

Examples:

STIME( ō13:05:10ö ) (returns ō1:05 pmö)

RANGE(  Returns the user-entered range specified.

Syntax:

RANGE(Number1)

Examples:

First Key in the Primary file is Vendor Number. RANGE( 1 ) (returns ōVendor Number - ZZZZZZZZZZö )

TOTAL(  Returns a total that is stored in the Report Generator (this should rarely, if ever be used).

Syntax:

TOTAL(Number1)

Examples:

The first total accumulated on the report is a sum of #Æs and this sum equals 500. TOTAL( 1 ) ( returns 500 )

COUNT(  Returns the count of detail lines printed within the section specified.

Syntax:

COUNT(SectionNumber1)

Examples:

Group 1 contains 10 detail lines for the group that this value is printed in. COUNT( 1 ) ( returns 10 )

The report contains 50 detail lines. COUNT( 10 ) ( returns 50 )

GRPCOUNT(  Returns the count of group breaks printed as it relates to a particular section.

Syntax:

GRPCOUNT(GroupNumber, SectionNumber)

Examples:

Group 1 has changed 15 times within Section 2. GRPCOUNT ( 1, 2 ) ( returns 15 )

Group 2 has changed 100 times for the entire report (Section 10). GRPCOUNT ( 2, 10 ) ( returns 100 )

GRPCHANGED(  Indicates whether a group has changed.

Syntax:

GRPCHANGED (GroupNumber)

Examples:

Group 1 totals have just been printed, but the next group 1 header has NOT been

printed. GRPCHANGED (1) ( returns 1 )

GRPPAGENO(  Group page number.

Syntax:

GRPPAGENO(GroupNumber)

Examples:

Group 2 has just changed on the 15th page of the report. GRPPAGENO(2) ( returns 1 )

PAGENO  Report page number.

Syntax:

PAGENO

Examples:

The 15th page of the report. PAGENO (returns 15)

DATE  Team Software system date.

Syntax:

DATE

Examples:

DATE (returns the date shown on the bottom panel in reverse date format ō19980717ö)

TIME  System time.

Syntax:

TIME

Examples:

TIME (returns the time shown on the bottom panel in military format ō13:05:10ö)

Syntax:

Examples:

USERNAME (returns the Name of the user who is logged in)

USERID  User ID.

Syntax:

USERID

Examples:

USERID (returns the ID of the user who is logged in)

MACHID  ID associated with the computer.

Syntax:

MACHID

Examples:

MACHID (returns the unique ID associated with this computer)

PERIOD  Team Software period.

Syntax:

PERIOD

Examples:

PERIOD (returns the period shown on the bottom panel)

IFCOND  User-entered If Condition.

Syntax:

IFCOND

Examples:

IFCOND (returns the If Condition entered by the user)

DESCEND  The word Descending if the descending flag is set.

Syntax:

DESCEND

Examples:

The user selected Descending. DESCEND (returns ōDescendingö) The user did NOT select Descending. DESCEND (returns ōö)

ASCEND  The word Ascending based on the descending flag.

Syntax:

ASCEND

Examples:

The user selected Descending. ASCEND (returns ōö) The user did NOT select Descending. ASCEND (returns ōAscendingö)

RPTTYPE  The user-entered Report Type.

Syntax:

RPTTYPE

Examples:

RPTTYPE (returns the type of report printed ( ōNormalö, ōGroup/Grand Totals Onlyö, etc.. )

LIMIT(  Returns the amount of a number that does not exceed a maximum limit, based upon a factoring number.

Syntax:

LIMIT (Number, Factor, Limit)

Examples:

Determine how much of an employeeÆs earnings in month 4 have not exceeded his State Unemployment Limit. (Number = month 4 earnings, Factor = month 1 + month 2 + month 3, Limit = State Unemployment Limit) LIMIT ( 1900, 5700, 7000 ) ( returns 1300 ) LIMIT ( 2200, 6600, 7000 ) (returns 400) LIMIT ( 2500, 7500, 7000 ) ( returns 0 )

OVERLIMIT(  Returns the amount of a number that exceeds a maximum limit, based upon a factoring number.

Syntax:

OVERLIMIT (Number, Factor, Limit)

Examples:

Determine how much of an employeeÆs earnings in month 4 have exceeded his State Unemployment Limit. (Number = month 4 earnings, Factor = month 1 + month 2 + month 3, Limit = State Unemployment Limit) OVERLIMIT ( 1900, 5700, 7000 ) ( returns 600 ) OVERLIMIT ( 2200, 6600, 7000 ) ( returns 1800 ) OVERLIMIT ( 2500, 7500, 7000 ) ( returns 2500 )

NEG(  Returns a positive or negative number, based upon a condition.

Syntax:

NEG (Number, Condition)

Examples:

NEG ( 1900, ōA=Bö ) ( returns 1900 )

NEG ( 1900, ōA=Aö ) ( returns ¢1900 )

MTD(  Returns a Month-To-Date figure based upon a date.

Syntax:

MTD(Date, Filename (dta prefix IS included), FieldName(Month # NOT included))

Examples:

Returns a monthly value from the Employee YTD file based upon the date and field specified. This example uses the field called Gross1ģGross12. MTD ( ō20000501ö or ō05/01/2000ö, dtaPREmpYTD, Gross ) (returns the amount stored in month #5 (i.e. dtaPREmpYTD!Gross5)

QTD(  Returns a Quarter-To-Date figure based upon a date.

Syntax:

QTD(Date, Filename (dta prefix IS included), FieldName(Month # NOT included))

Examples:

Returns a quarterly value from the Employee YTD file based upon the date and field specified. This example uses the field called Gross1ģGross12. QTD ( ō20000501ö or ō05/01/2000ö, dtaPREmpYTD, Gross ) (returns the sum of the amounts stored in months #4 through #5 (i.e. dtaPREmpYTD!Gross4 + dtaPREmpYTD!Gross5)

YTD(  Returns a Year-To-Date figure based upon a date.

Syntax:

YTD (Date, Filename (dta prefix IS included), FieldName(Month # NOT included))

Examples:

Returns an annual value from the Employee YTD file based upon the date and field specified. This example uses the field called Gross1ģGross12. YTD ( ō20000501ö or ō05/01/2000ö, dtaPREmpYTD, Gross ) (returns the sum of the amounts stored in months #1 through #5 (i.e. dtaPREmpYTD!Gross1 + dtaPREmpYTD!Gross2 + dtaPREmpYTD!Gross3 + dtaPREmpYTD!Gross4 + dtaPREmpYTD!Gross5)

DEVNAME  System output device (ōScreenö or printer device name).

Syntax:

DEVNAME

Examples:

DEVNAME (returns the name of the system output device ( ōSCREENö, ōEpson Stylus 850ö, etc.. )

No Right Mouse