+ Reply to Thread
Results 1 to 10 of 10

Thread: Day of the Week

  1. #1
    Guest.Visitor Guest

    Default 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. Default Day of the Week

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

  3. Default Day of the Week

    How should XXX be defined????

  4. #4

    Default Day of the Week

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

  5. #5
    Guest.Visitor Guest

    Default 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. #6
    Guest.Visitor Guest

    Default 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. #7
    Guest.Visitor Guest

    Default Day of the Week

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

  8. Default 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. #9
    Guest.Visitor Guest

    Default 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. #10

    Default 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 ?

+ Reply to Thread

Similar Threads

  1. Day of the week
    By Guest.Visitor in forum Programming
    Replies: 12
    Last Post: 12-19-2001, 08:16 AM
  2. I need to know what day of the week
    By Guest.Visitor in forum Programming
    Replies: 6
    Last Post: 07-19-2001, 01:45 PM
  3. Get the day of the week in CL
    By Guest.Visitor in forum Programming
    Replies: 14
    Last Post: 08-25-1998, 04:21 PM
  4. What day of week is this???
    By Guest.Visitor in forum Programming
    Replies: 7
    Last Post: 11-25-1997, 12:20 PM
  5. Day of Week
    By M.Martinez in forum Programming
    Replies: 2
    Last Post: 08-19-1997, 11:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts