Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Washington, DC - USA
    Posts
    53

    Question Unanswered: Select where date difference > 5

    Hi,

    I have a table called "Projects", which looks like this:

    Code:
    ProjectName      ProjectStart      ProjectEnd
    --------------------------------------------------
    Larson                10/10/02           10/20/02
    Wilson                11/15/02           12/15/02
    Max                    01/06/03           01/07/03
    Silas                   03/14/03           07/01/03

    I need to pull all records where ProjectEnd is 5 days or more past ProjectStart. So, in the example I listed above, all the entries except for "Max" would be pulled in my SELECT.

    Does anyone know how to do this?

    Thanks!

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

    Re: Select where date difference > 5

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

  3. #3
    Join Date
    Sep 2003
    Location
    Washington, DC - USA
    Posts
    53

    Re: Select where date difference > 5

    Originally posted by DoktorBlue
    SELECT * FROM Projects
    WHERE DateDiff(dd, ProjectStart, ProjectEnd) > 5
    You are my new best friend.

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

    Re: Select where date difference > 5

    Please, no kissings or huggings, I prefer beer.
    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
  •