Upload
alicia-walton
View
221
Download
0
Embed Size (px)
DESCRIPTION
Formatting Functions NAMER – formats name namer(rgid);nmfirm;nmaddr1;nmaddr2;nmcity,nmstate,nmzip
Citation preview
Chuck’s Academy of
Function Anatomy
An ACEware Webinar
Part 2
Function Academy – Part 2
• Formatting Functions• Function Categories• Especially Cool!• Advanced and
Specialized
Formatting Functions
NAMER – formats name
namer(rgid);nmfirm;nmaddr1;nmaddr2;nmcity,nmstate,nmzip
Formatting Functions
NICEDATE – formats datenicedate(cobegdate,coenddate) nicedate(cobegdate,coenddate,3)
Formatting Functions
SHOWPHON – formats phone numbershowphon(indphone,"Day: ");showphon(inhphone,"Eve: ")
Formatting Functions
CSZR – concatenates city, state and zip (frequently combined with other functions)namer(nmid);nmtitle;nmaddr1;nmaddr2;cszr(nmid);nmcntry
Other Function Categories
Especially cool!
AGE – Calculates the number of years between two datesAGE(nmbirth)
Especially cool!
GETDATA – Opens a message box in which you can enter a temporary message to be used in a report. (Used in a JUSTDOIT)
Required Parameters:
Character title expression (i.e. text that will display at the top of the message box)
Input variable. Variable can be a date, (e.g. ctod('//') ), a number (e.g. 0.00), or character. If character, use the SPACE() function to specify desired length (i.e. SPACE(50) creates a data entry field 50 characters in length). Note: if you wish to enter a large text block (i.e. a memo), enter a space value 251- SPACE(251). This will let you enter large blocks of text in a scrolling data window.
Especially cool!
GETDATA (continued)
Especially cool!
JUSTDOIT with GetData Function
GetData Function
Especially cool!
WHAZZIS – Displays query used on reportwhazzis(.t.)
Optional Parameters:"A" = Query Name, Query Field and Query Value"Q" = Query Name Only"V" = Query Value Only"QV" = Query Name and Value"+" = Query Name and Report Name"++" = Query Name, Report Name and Report Title
Especially cool!
QuikCode – shows code description (instead of code)iif(empt(rgtrack),'NO CODE',quikcode(RGTRACK))
Chuck’s Favorites
Sometimes we have to humour the boss!
SHOWEXP
Don’t forget to add your formatting!
SHOWEXP
ADDOMNI
When it absolutely, positively has to be there!Returns any field from any table in the system (key value must be in cursor).
Required Parameters:Table you want to return a field from in quotes (i.e. "NAMES", "COURSE",
"REGISTER")
Key from above table in quotes (i.e. "nmid" or "nmid+rgcrse")
Key from report cursor, NO quotes (i.e. nmid or nmid+cocrse)
Field from specified table to return (i.e. "nmsalut", "cosubcode", "rggrade")
FINDINST
FINDINST can display more than a name!1= Name and SSN2= Name only3= Name, day phone, and eve phone4= Name-Last Name, First Name5= Name and Address in block form6= Name, Address and Phone #'s in block form7= Name and user defined char string (enter char string as parameter 3)8= Name, SSN, and Pay description
Justdoit
JUSTDOIT is a specialized report function that uses SQL to request and manipulate information from the data tables.
What can a JUSTDOIT do?• change the sort order of data in a report• filter out unwanted data• execute specialized report functions
– gradspec– getdata
Writing a Justdoit
All JUSTDOIT’s that change the output order, eliminate duplicates or filter begin the same:
justdoit(‘select *,0 as marker from (cursor5)
And continue with Order, Group, or Where
Writing a Justdoit
Where States a conditional clause that data must meet to be included in the report (e.g. where due-paid > 0.00)
Group by Groups data in the cursor by the field you specify, then removes all but one record for each group
Order by Changes the sort order of data in the cursor
Into cursor (cursor?) Tells the system to place the data back into the cursor once it has finished executing all the select statements,
And finishes with . . .
Justdoit Examples
Change the Sort Order of Report with "Order By" Statement justdoit(‘select *,0 as marker from (cursor5) order by
nmname3,nmname1 into cursor(cursor5)’)
Eliminating Duplicate records with the "Group By" Statement JUSTDOIT(‘select *,0 as marker from (cursor5) group by
nmid,nmname3 into cursor(cursor5)’)
Filter the report with "Where" Statement JUSTDOIT(‘select *,0 as marker from (cursor5) where due-paid>0.00
into cursor(cursor5)’)
Justdoit
The JUSTDOIT expression box may be placed anywhere on the report template but we recommend placing it in the header band of the report. It's a non-printing element and will not display on the report itself.
Adding a field with a JUSTDOIT
Add a field to the Cursor and then Sort by it JUSTDOIT(‘select *,addcrse(cocrse,"cobegdate") as date, 0 as marker
from (cursor5) order by date into cursor(cursor5)’)
Use the ADDCRSE function & add “as date” which identifies the new field for the cursor and continue
with the justdoit
Additional Help
A plethora of additional information on all functions is available in the online help
or . . .
Call your tech!
Questions???
Our next webinar . . .
Wednesday, June 30th
1:00 Central
When we unveil the all new 7.2!