It is absolutely amazing how many times this situationoccurs in DP. Next to the DOLLAR SIGN, dates are the most important datum in any business function. If you have ROBOT it has a day of week function. If youcan find it, there is an API for it, but I have never looked... The one I use is in the 1934 edition of Websters New collegiate Dictionary ;; by the way it works through2299 and is under perpetual calendar; It goes as follows: 1. take the last two figures of the year (e.g. 97) and add the integer(yy/7) (no decimal fraction); 2. for the current century add 0; for the next century, add 6.3 for the months add: 0 for april or july; 1 for jan or oct; 2 for May; 3 for aug; 4 for feb mar or nov; 5 for june; 6 for sept or dec; if a leap year use instead 0 for jan & 3 for feb.4. add the day of month;5 divide the result by 7 and the remainder will represent the DOW: with 0 = sat; 1 = sun etc. I have programmed this algorithm in assembler, algol, cobol and RPG and I know of a version in Auto-coder, C and PASCAL. Incidently ;; january 1st, 2000 will be Saturday; check it out.this means monday jan 3rd , 2000 will be a holiday so we will nothave to worry about 2 digit year stuff until tuesday! bob hamilton, texas business systems; 736 pinehurst; richardson, texphone 817-898-6770 off; 972-705-9214 home... No One Ever Needed a Smaller, Slower PC

Reply With Quote
+ mm + dd ) ,7 ) = 0 then "Saturday"; OR = 1 then "Sunday"; et c ) . the case statement give s the correction for century nbr. i dont haveat hand the nbr for 17th and 18th centruy, but 19 is 0) No One Ever Needed a Smaller, Slower PC
