×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Year Format

Year Format

Year Format

(OP)
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?  

RE: Year Format

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

RE: Year Format

(OP)
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

RE: Year Format

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.

RE: Year Format

(OP)
Okay.  I did that. We get the following error message:

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: DEFINE

Thanks for your help!

bsneln

RE: Year Format

Sounds like there's something before your DEFINE that doesn't belong there.

RE: Year Format

Did you remember to remove the original DEFINE FILE TIMESHEETS?

RE: Year Format

(OP)
Got the procedure to work now by defining a new field as the YY format and are no longer receiving the error message.  Thanks!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close