Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    7

    Unanswered: dealing date ranges

    Hi,

    I want to use select all the records between certain date ranges. Like, Select * from table1 where table1.date is between <startdate> and <enddate>

    How do i write a query for this?

    Thanks for your help!
    Pradeep.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Select * from table1 where table1.date is between '2002-01-20' and '2002-01-30'
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Dec 2003
    Posts
    7
    Thank you!

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Actually, you may need to get rid of the word "is". It is definitely not necessary and may cause a syntax error.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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