DEFINE FILE CAR NUMDAYS/I10 WITH CAR = DATEDIF('20110501','20110531','WD'); END TABLE FILE CAR PRINT NUMDAYS END
I get 21, but I think I should get 22? But when I do this:
DEFINE FILE CAR NUMDAYS/I10 WITH CAR = DATEDIF('20110401','20110430','WD'); END TABLE FILE CAR PRINT NUMDAYS END
I get 21, which would be correct. Does anyone know why this function works for April, but not May? Thanks!This message has been edited. Last edited by: Kerry,
not correct? sure...May has 31 days...but you should not start at the 1ste of May but at the last day of April
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
May 04, 2011, 11:59 AM
<JG>
Frank, then why does it work for April.
Actually this is a real bug.
Pick any month where the 1st starts on a weekend and the answer is -1 day
May 04, 2011, 01:26 PM
Mark1
Yeah, after I posted, I wracked my brain trying to figure it out and realized that when you do datediff, normally you have to put +1 on the end of it (if you want the days of the month). So, if I'm just doing work days, and the last day of the month is a weekend, you don't have to do that... it is inherently done for you. So, in looking at datedif each month from Jan to October of 2011, only April and July are correct b/c they are the only two months that end on Saturday or Sunday. IBI really needs to focus on making functions more user-friendly or at least include this in documentation, IMHO.
Windows version 768
May 05, 2011, 10:30 AM
Mark1
quote:
Originally posted by Tom Flynn: In the U.S., we don't work on Memorial Day...