Text Only Browsers Index

 

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.

  1. Create A Report
    1. Open a new report in Report Assistant
    2. Choose the EMPDATA table
    3. Select the following sort fields
      1. LASTNAME
      2. FIRSTNAME
    4. Select the following column field
      1. HIREDATE
    5. Choose DETAIL as the report type

  1. Create Define Fields to perform Date functions
    1. Click on the COMPUTE tab
    2. Click New Define
    3. 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.

  1. Choose Your Column Fields
    1. Click the FIELDS tab
    2. Click on the fields CurrentDate, and Totaldaysofwork.

  2. Choose Options
    1. Choose PDF in Display Format
    2. Submit the program to see that you are reporting the correct information (see attached report).

  3. Heading Dates
    1. Click HEADINGS tab
    2. 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

Go to M.U. Contacts Go to M.U. Search Go to M.U. Home