DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: sql help

  1. #1
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401

    sql help

    Guys,

    I would like to know how to retrieve data between from a monday to sunday

    For example from the 17th to 23 feb2003.I don't want to hard-code the dates but i want to tell the query to pull the data from monday to sunday of previous week


    thanks for help in advance.

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    Use the day of week component (0-6, 1-7).

  3. #3
    Join Date
    Jul 2002
    Location
    Washington DC
    Posts
    110
    OR between next_day(sysdate,'MON')-7 and next_day(sysdate,'MON')-1

  4. #4
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi,

    I think it should be..

    between next_day(sysdate,'SUN')-7 and next_day(sysdate,'MON')-1

    CAUSE UR USING BETWEEN..

    Thanks
    pras
    Dream as if u'll live forever..Live as if u'll die today.

  5. #5
    Join Date
    Mar 2001
    Location
    south africa
    Posts
    401

    thank you

    Thx for the help guys !!!!!

Posting Permissions

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


Click Here to Expand Forum to Full Width