Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    5

    Unanswered: [query] Specific Date between 2 dates

    Hi,

    I've got a table which containts the following fields
    DossierID, Datum_start, Datum_end

    When I want to select all the DossierID's between 2 dates my query is (for example):
    SELECT dossierID
    FROM table
    where Datum_start > 2005-01-01 and Datum_end < 2005-05-01

    However, Let's say I've got the following situation:

    Dossierid= 8
    Datum_start = 2005-01-01
    Datum_end = 2005-05-01

    I want to see which DossierID is active on 2005-03-08, the result of the query should be the above result. My question is, what should the query be?

  2. #2
    Join Date
    Apr 2005
    Location
    Lier, Belgium
    Posts
    122
    Quote Originally Posted by TheWock
    However, Let's say I've got the following situation:

    Dossierid= 8
    Datum_start = 2005-01-01
    Datum_end = 2005-05-01

    I want to see which DossierID is active on 2005-03-08, the result of the query should be the above result. My question is, what should the query be?

    Code:
    SELECT
        DossierID
    FROM table
    WHERE
        '2005-03-08' BETWEEN Datum_start AND Datum_end;
    --
    felix

Posting Permissions

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