Returning records between two dates

Results 1 to 2 of 2

Thread: Returning records between two dates

  1. #1
    Paul Giancola Guest

    Default Returning records between two dates

    I am attempting to return records from a database where the dates are formated as such.<BR><BR>01/Jan/2000<BR><BR>I am attempting to select records between a range of dates using the following syntax...<BR><BR>...WHERE created &#062;= &#039" & date - 7 & "&#039 AND created &#060;= &#039" & date & "&#039...<BR><BR>(Just so you know I made sure the machine date is formated the same as the one in the database.)<BR><BR>What gets returned are all records between the days which are first in the date string.<BR><BR>For example, today&#039s date would be 28/Nov/2000. Say I wanted all records created between today and 20/Nov/2000. The query would return all records where the day falls between the 20 and 28, but the month will be any, so I will get all months, not just those from November.<BR><BR>The date is a result of an Oracle situation here. This is driving me crazy. Does anyone have any ideas?<BR><BR>Any help would be most appreciated.

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Returning records between two dates

    "where created &#062;= dateadd(day,-7,&#039" & date & "&#039 and created &#060;= &#039" & date & "&#039"<BR><BR>this is what i use in MSSQL i dont know if it will work in Oracle but i would assume this is the same

Posting Permissions

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