-SET &ECHO='ALL'; -*RETAILER WEEK IS FROM SUNDAY TO SATURDAY SET WEEKFIRST = 1; -********************************************************************************** -*set up defaults -DEFAULT &OUTPUT = 'HTML'; -DEFAULT &COMPANY = '$*'; -DEFAULT &DIVISION = '$*'; -DEFAULT &SEASON='$*'; -DEFAULT &YEAR='$*'; -DEFAULT &BRAND ='$*'; -DEFAULT &RETAILER ='$*'; -DEFAULT &INDATE = '$*'; -* -* -********************************************************************************** -*SET REPORT OUTPUT -SET &HLD = '-*'; -IF &OUTPUT EQ 'REPORT' GOTO SKIPHOLD; -SET &HLD = IF &OUTPUT EQ 'PDF' THEN 'ON TABLE PCHOLD FORMAT PDF' - ELSE IF &OUTPUT EQ 'EXL2K' THEN 'ON TABLE PCHOLD FORMAT EXL2K' - ELSE &HLD ; -SKIPHOLD -********************************************************************************** -*SET PATH TO GET FILES APP MAP FOCHOLD C:\Inetpub\wwwroot\Output_Hold\ APP HOLD FOCHOLD -* -* GET NRF CALENDAR DATES FOR MONTH-TO-DATE DEFINE FILE MK_CALENDR IN_DATE/HYYMD = DT(&YYMD 12:00:00); -IF &INDATE EQ '$*' THEN GOTO SKIP_INDATE; -IF &INDATE EQ '' THEN GOTO SKIP_INDATE; IN_DATE/HYYMD = DT(&INDATE 12:00:00); -SKIP_INDATE OUT_F/YYMD = DATECVT(NRF_FROM, 'I8YYMD','YYMD'); OUT_T/YYMD = DATECVT(NRF_TO, 'I8YYMD','YYMD'); OUT_FROM/HYYMD = HDTTM(OUT_F, 8,'HYYMD'); OUT_TO/HYYMD = HDTTM(OUT_T, 8,'HYYMD'); OUT_2/HYYMD = HADD(OUT_TO, 'DAY',1, 8,'HYYMD'); END TABLE FILE MK_CALENDR PRINT IN_DATE OUT_F OUT_T OUT_2 WHERE IN_DATE GE OUT_FROM; WHERE IN_DATE LT OUT_TO; -*ON TABLE HOLD AS CLL FORMAT ALPHA END -*RUN -*READ CLL &I_FROM.A8. &I_TO.A8. -*TYPE &I_FROM -*TYPE &I_TO
Evrything works fine except when the "TO" date is equal to one of the "END DATES", then it all blows up for some reason because I assume it doesn't find the end date. I f I change OUT_2 for OUT_TO the n it works.
MY QUESTION, is this normal behaviour for smart dates? When you use the built in functions for converting/creating smart dates what gets put into the time portion?
Just a inquiry so I know how code smart-dates in the future.This message has been edited. Last edited by: <Mabel>,
October 12, 2004, 07:25 PM
susannah
These aren't smart dates. they're date-times; totally different animals. If you don't need time, or you dont need the special formatting available to datetimes, just use smart dates. also SKIP is a java reserved word (see thread way down on this board) so you may blow up at some point, depending on your version. So i recommend changing it to SKP
October 12, 2004, 08:26 PM
TexasStingray
TRY using LE to date you have LT to date
October 14, 2004, 01:10 PM
Lloyd
In the originsal version it was LE, when I pushed the to-date 1 day forward I changed it to LT. What I'll do is follow susanah's suggestion and work with the YYMD format of the dates (without the time portion).