Focal Point
Weekdays on older versions

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1611021641

December 29, 2005, 10:53 AM
Stan
Weekdays on older versions
Does anyone have an example of some code to calculate the number of weekdays between two dates on a system too old to have the newer functions for weekday/business day, etc.? (One of our versions is very outdated).

Thanks,
Stan
December 29, 2005, 04:20 PM
susannah
hmmm, you have the DOWK function, yes?
and you can make at least make your dates into smartdates, yes? DATECVT for example?
or if not and your date is text then
iTEMP/I8 = EDIT(SOMEDATE);
iitemp/I8YYMD = iTEMP;
START/YYMD = iiTEMP ;

figure out what day of week your start date is
add enough days to it to get to the next sunday.
figure out what day of week your end date is,
subtract enough days to get it to the previous saturday
measure the difference
divide by 7 to get the # of weeks
multiply by 5 to get the total number of business days in those weeks.
add back whatever business days you had to adjust at both ends.
Getting the idea?
Do you have DATEMOV function? probably not, right?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 29, 2005, 04:39 PM
Stan
Got it...Thanks! No DATEMOV function yet on this version. We had it all working fine in WebFOCUS, but it was simply taking too long and we decided to batch up a Unix FOCUS run each night to get the data...but our version of UnixFOCUS is pretty old...as am I. Smiler

Thanks