DATE SUBDUR D'0001-01-01' DATEDIFF:*D DATEDIFF DIV 7 XXX MVR REM (1.0) REM = 0: Monday 1: Tuesday 6: Sunday
DATE SUBDUR D'0001-01-01' DATEDIFF:*D DATEDIFF DIV 7 XXX MVR REM (1.0) REM = 0: Monday 1: Tuesday 6: Sunday
Is that the right syntax for the first line, factor 2
How should XXX be defined????
You can also use the CEEDAY(S) routine to retrieve day of week. Dave
Yes. The date in *ISO fmt minus the *loval Date (January 1, 0001). Works for all Dates from January 1, 1 to December 31, 9999.
xxx is a dummy-Variable. For checking the Day of Week, we need only the remainder from MVR opcode. I definde XXX as 11.0
CAN NOT UNDERSTAND , HOW FACTOR 2 CAN HOLD D'0001-01-01' DATEDIFF:*B ?
Is there and easy way to calculate the day of the week? Is it Monday Tuesday or Wednesday for example.
RPGIV is a beautiful thing! Here's a .zip if you want some date procedures.
p DayOfWeek b Export d DayOfWeek pi 1s 0 d InputDate d Const d DayOfWeek s 11s 0InputDate subdur d'1998-08-01' DayofWeek:*D div 7 DayofWeek mvr DayOfWeek if DayOfWeek > 0 return DayOfWeek else return DayOfWeek + 7 endif p DayOfWeek e p DayName b Export d DayName pi 32a Varying d InputDate d Const d ds d Days 70a Inz('Sunday + d Monday + d Tuesday + d Wednesday + d Thursday + d Friday + d Saturday ') d Day 10a Dim(7) Overlay(Days)return %trim(Day(DayOfWeek(InputDate))) p DayName e
Date Procedures.zip
Factor 2 has D'0001-01-01' and the result field has DATEDIFF:*D. BORIS KUSHNIR wrote: > > CAN NOT UNDERSTAND , HOW FACTOR 2 CAN HOLD D'0001-01-01' DATEDIFF:*B ?