Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: Query to find first sunday in a given month?

    Hi

    I am new to informix,
    I want to find date of first sunday on a given month, we have next_day function in oracle, is there any funtion like this in informix?
    sql query which return the date of first sunday will be help full.

    thanks
    ashok

  2. #2
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177
    There is no function to do this but you can use the WEEKDAY() function and derive the value. For example:

    select first 1 case weekday('03/01/2004')
    when 0 then 1
    else (8 - weekday('03/01/2004'))
    end
    from systables;

    The date you would supply is the 1st of the month in question.
    Fred Prose

Posting Permissions

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