1. Guest.Visitor Guest

Day of the Week

DATE SUBDUR D'0001-01-01' DATEDIFF:*D DATEDIFF DIV 7 XXX MVR REM (1.0) REM = 0: Monday 1: Tuesday 6: Sunday

2. Join Date
Dec 1969
Posts
36

Day of the Week

Is that the right syntax for the first line, factor 2

3. Join Date
Dec 1969
Posts
36

Day of the Week

How should XXX be defined????

4. Senior Member
Join Date
Dec 2007
Posts
3,908

Day of the Week

You can also use the CEEDAY(S) routine to retrieve day of week. Dave

5. Guest.Visitor Guest

Day of the Week

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.

6. Guest.Visitor Guest

Day of the Week

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

7. Guest.Visitor Guest

Day of the Week

CAN NOT UNDERSTAND , HOW FACTOR 2 CAN HOLD D'0001-01-01' DATEDIFF:*B ?

8. Join Date
Dec 1969
Posts
36

Day of the Week

Is there and easy way to calculate the day of the week? Is it Monday Tuesday or Wednesday for example.

9. Guest.Visitor Guest

Day of the Week

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 0
InputDate 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

10. Senior Member
Join Date
Dec 1969
Posts
531

Day of the Week

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 ?