ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

day from date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • day from date

    Hi all,
    Please tell me how to find out day(Monday, Tuesday etc) given a date.

    Thanks,
    sateeshs

  • #2
    Re: day from date

    Hi sateeshs:

    Take a look at this post:



    That should give you some ideas.

    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: day from date

      Hi,

      the easiest way is to use embedded SQL.
      SQL delivers several scalar functions to determine the day of week.
      • DAYOFWEEK(Date): Returns the day of week from a date where sunday=1 and saturday = 7
      • DAYOFWEEK_ISO(Date): Returns the day of week according to ISO guidelines, that means Monday = 1 and Sunday = 7
      • DAYNAME(Date): Returns the name of the week day


      Some times ago I wrote an article for Centerfield about SQL date functions and how to use them in RPG:
      http://www.centerfieldtechnology.com/publications/archive/Aug%202006A.pdf
      Page 4

      Birgitta
      Last edited by B.Hauser; May 21, 2008, 12:59 PM.

      Comment


      • #4
        Re: day from date

        Euh, Birgitta,

        # DAYOFWEEK(Date): Returns the day of week from a date where sunday=1 and saturday = 1
        # DAYOFWEEK(Date): Returns the day of week according to ISO guidelines, that means Monday = 1 and Sunday = 1
        IMHO, if I'm not mistaken, shouldn't that be
        #DAYOFWEEK(Date): Returns the day of week from a date where sunday=1 and saturday = 7
        #DAYOFWEEK_ISO(Date): Returns the day of week according to ISO guidelines, that means Monday = 1 and Sunday = 7
        Philippe

        Comment


        • #5
          Re: day from date

          RUN FOR THE HILLS!!!! HE CORRECTED BIRGITTA!!!

          OMG!!! LOCUSTS WILL INHABIT OUR CARCASES AND FIRE WILL CONSUME US! AHHHHHHHHHHHHHHHHHHH!!!

          Comment


          • #6
            Re: day from date

            RUN FOR THE HILLS!!!! HE CORRECTED BIRGITTA!!!
            It was only a test, to see if someone reads my comments
            Post corrected!

            Birgitta

            Comment

            Working...
            X