Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Date math and formatting
Go
New
Search
Notify
Tools
Reply
  
Date math and formatting
 Login/Join
 
Gold member
posted
I need to calculate the first date of the current month and the first date of the previous month. I also need to display the previous month and year in the header. I have the first date of each month working but I would like the date in the header to be mixed case.
Here is my code:
-SET &START_DATE = &YYMD;
-SET &END_DATE = &YYMD;
-SET &DAY = EDIT(&YYMD, '$$$$$$99');
-SET &END_DATE = DATEADD(&END_DATE,'D',-&DAY+1);
-SET &START_DATE = DATEADD(DATECVT(&END_DATE, 'I8YYMD', 'YYMD'),'M',-1);
-SET &START_DATE = DATECVT(&START_DATE, 'YYMD', 'I8YYMD');
-SET &START_DISP = CHGDAT('YYMD', 'MYYX', &START_DATE, 'A17');

The &START_DISP uses MYYX to get long months but they come out in upper case only.
Is this the best way to do this type of calculation? I need it in a seperate fex that other fexes can include.
Thanks
 
Posts: 81 | Location: Calgary, Alberta | Registered: August 07, 2003Reply With QuoteReport This Post
<Pietro De Santis>
posted
Use the LCWORD function:



-SET &RUN_DATEX = CHGDAT('YYMD', 'MXDYY', &YYMD, 'A17');
-SET &RUN_DATE = LCWORD(&RUN_DATEX.LENGTH, &RUN_DATEX, 'A17');

This message has been edited. Last edited by: <Mabel>,
 
Reply With QuoteReport This Post
Gold member
posted Hide Post
Way Cool ! Exactly what I was looking for.
Thanks.
 
Posts: 81 | Location: Calgary, Alberta | Registered: August 07, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Another way is as follows:

TRD/I8 = &TRDATE ;
TRDTA/I8YYMD = TRD ;
TRDT/YYMD=TRDTA;
TRDTS/HDMtYY=HDTTM(TRDT,8,'HDMtYY');

This will give 11 Jun 2004 in TRDTS.

David
 
Posts: 116 | Location: US | Registered: February 09, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Date math and formatting

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.