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
June 10, 2004, 08:30 PM
<Pietro De Santis>
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>,
June 10, 2004, 08:36 PM
Nightowl
Way Cool ! Exactly what I was looking for. Thanks.