Results 1 to 2 of 2

Thread: date criteria

  1. #1
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Unhappy Unanswered: date criteria

    I’m looking for a SELECT statement to pull all records from a table where the difference between two dates (columns in the table) are greater than a certain number (5 in this case.)

    So let’s say there’s a table called “Projects”, and in this table is “ProjectStart” and “ProjectComplete”. I would need all the records where the “ProjectComplete” is more than 5 days past “ProjectStart”.


    (So for example a ProjectStart of 9/8/03 and a ProjectEnd of 9/10/03 wouldn’t show up, but a ProjectStart of 8/5/03 and a ProjectEnd of 9/22/03 would.)


    Thanks!

  2. #2
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: date criteria

    SELECT * FROM Projects
    WHERE DateDiff(dd, ProjectStart, ProjectComplete) > 5
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

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