Announcement Announcement Module
Collapse
No announcement yet.
Day of the Week Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

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

    Comment


    • #3
      Day of the Week

      How should XXX be defined????

      Comment


      • #4
        Day of the Week

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

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              Day of the Week

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

              Comment


              • #8
                Day of the Week

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

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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 ?

                    Comment

                    Working...
                    X