Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Year Format 1

Status
Not open for further replies.

bsneln

MIS
Jul 26, 2004
6
US
We have a field with a MDYY format. We need to be able to select just the year for the report to run. When we select the year, the report will display showing the MDYY formatted in another column.

How do we do this?
 
Are you computing the YEAR off the date rather than defining? When you use compute the report automatically includes the field used in the compute in the report. If this is what's causing the problem there are two options:

1. Move your compute into a define
2. Add the field yourself into the report with the NOPRINT command after it.

If you are not using a compute, provide a few more details of where and how you are extracting the year for me.

Tewy
 
To initiate this report, we will have the user select the "Year" for the report.

Then we want the report to display:
Title: Year To Date Summary

Headings:
PAY
PERIOD example - 02/15/2000
REGULAR
OVERTIME
ANNUAL
SICK SICK
FAMILY STATE
COMP FED
COMP HOLIDAY
COMP
HOLIDAY
OTHER

Here is the first part of the code:
-* File YTDSum.fex
DEFINE FILE TIMESHEETS
YEAR/YY=YEAR( TIMESHEETS.TIMEDATE );
END
TABLE FILE TIMESHEETS
PRINT
'TIMESHEETS.REGULAR'
'TIMESHEETS.OVERTIME'
'TIMESHEETS.ANNUAL'
'TIMESHEETS.SICK'
'TIMESHEETS.SICKFAM' AS 'SICK,FAMILY'
'TIMESHEETS.COMP' AS 'STATE,COMP'
'TIMESHEETS.FEDCOMP' AS 'FED,COMP'
'TIMESHEETS.HOLCOMP' AS 'HOLIDAY,COMP'
'TIMESHEETS.HOLIDAY'
'TIMESHEETS.OTHER'
BY
'TIMESHEETS.USERID' NOPRINT
BY
'TIMESHEETS.TIMEDATE' AS 'PAY,PERIOD'
BY
'TIMESHEETS.TIMEDATE' NOPRINT AS 'YEAR'
HEADING
"Year To Date Summary"
" "
" "
" "
FOOTING
"Prepared on <+0>&DATEtMDYY <+0> "
WHERE ( USERID EQ '&USERID.UserID.' );
ON TABLE SET PAGE-NUM OFF
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'YTD'
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET WEBVIEWER ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *

When run, we get the error message of Error:

(FOC263) EXTERNAL FUNCTION OR LOAD MODULE NOT FOUND: YEAR

Our version says its 524.

We tried to use a maintain specific legacy date function above (YEAR), but it didn't work. Any ideas?

bsneln
 
Replace your DEFINE with:

DEFINE FILE TIMESHEETS
YEAR/YY=TIMESHEETS.TIMEDATE ;
END

Setting a DATE format field to a date containing only the year in the format will do the conversion automatically.
 
Okay. I did that. We get the following error message:

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: DEFINE

Thanks for your help!

bsneln
 
Sounds like there's something before your DEFINE that doesn't belong there.
 
Got the procedure to work now by defining a new field as the YY format and are no longer receiving the error message. Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top