|
|
|
WebFOCUS
Techniques

Include
Date Functions and Features in a Report
When creating
a report, you often want to include date functions and features in the
report. Examples would be current date posted in the heading, elapsed
days between a date field and today’s date, Focus date functions that
begin with ‘&’, etc.
The following
exercise using the EMPDATA table will illustrate Date formats and functions.
The EMPDATA table is used because it is a vender – supplied file that
contains sample data that is not confidential Miami data.
- Create
A Report
- Open
a new report in Report Assistant
- Choose
the EMPDATA table
- Select
the following sort fields
- LASTNAME
- FIRSTNAME
- Select
the following column field
- HIREDATE
- Choose
DETAIL as the report type
- Create
Define Fields to perform Date functions
- Click
on the COMPUTE tab
- Click
New Define
- Create the DEFINE fields as follows and Click OK
Place the current date in a DEFINE field.
The technique
for CurrentDate is used to get today’s date in the proper format so
that it can be used in a calculation. *Above please note that the format
box contains ‘YYMD’. This produces Century Year, Month, Day.
‘&YMD’
is the function used to retrieve Year, Month, Day.
Calculate
the total number of days an employee has worked.
Subtract the HIREDATE contained in the EMPDATA table from the CurrentDate
DEFINE field.
- Choose
Your Column Fields
- Click
the FIELDS tab
- Click
on the fields CurrentDate, and Totaldaysofwork.
- Choose
Options
- Choose
PDF in Display Format
- Submit
the program to see that you are reporting the correct information
(see attached report).
- Heading
Dates
- Click
HEADINGS tab
- In
the open box insert the date function.
- Heading
/ Footing date functions are as follows:
&DATEMDYY
= 05/21/1999
&DATEYYMD
= 1999/05/21
&DATEDMYY = 21/05/199
&DATE = 05/21/99
&YMD = 990521
&MDY = 052199
&DMY = 210599
&DATEMTRDYY = OCTOBER 19, 1999
&DATEMtrDYY = October 19, 1999
&DATEMtDYY = Oct 19, 1999
&TOD = 10.13.50 (time of day)

C. Save your program then Submit your program (see attached).

MCIS Documentation and Information page at Miami
University
|