Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    34

    Unanswered: Between times in dates problem

    Hello guys,
    I'm having a problem here and while I'm sure there's a simple solution I can't seem to find it.

    I'm connecting to an ACCESS Database from VB using OLEDB.

    I have events labled with dates and exact time.


    What I want to do with an SQL quary is to find all kind of events that are between a certain hour on a certain date to another hour in another date.

    i.e.

    16/02/2004 16:00 to 17/02/2004 17:00

    What I was able to get so far is everything between 16:00 and 17:00 on those dates which isn't exactly what I wanted.. can anyone help me with that?

    Thanks
    Chen

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try

    SELECT * from ..... WHERE yourDateField Between #02/16/2004# AND #02/17/2004#

    Also


    SELECT * from ..... WHERE yourDateField Between #02/16/2004 16:00# AND #02/17/2004 17:00#

  3. #3
    Join Date
    Mar 2004
    Posts
    34
    And in case the date field is text and the time is another text field?

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by Wolverchenus
    And in case the date field is text and the time is another text field?
    SELECT * from ..... WHERE yourDateField Between Forms!urFormName.urTextBox1 AND
    Forms!urFormName.urTextBox2

  5. #5
    Join Date
    Mar 2004
    Posts
    34
    Thanks.

Posting Permissions

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