Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    11

    Time queries

    I need to selet events from a table that happen during a certain time period. The only problem is how do you do this when the time period involved is over two days?

    In my table I have start time and end time.

    EX.

    Start Time/End Time
    0630/0800
    0800/0100
    2300/0430


    0400/0530
    1200/1300
    2200/2300


    I want to select al the events that take place between 2200 and 0600. The following results should come back:

    0800/0100
    2300/0430
    0400/0530
    2200/2300

    And help you can provide would be greatly appreciated.

  2. #2
    Join Date
    Jun 2006
    Location
    USA
    Posts
    6
    Hello:

    You need to figure in a date field some how and then calculate the difference between Now and the desired date. The following may help you:

    The DateDiff function displays the variance in days between the values of the OrderDate and ShippedDate fields.
    '
    DateDiff("d", [OrderDate], [ShippedDate])
    '
    The DateAdd function displays a date that is 10 days before the value of the PromisedDate field.
    '
    DateAdd("y", -10, [PromisedDate])

    Regards
    Mark

  3. #3
    Join Date
    Feb 2006
    Posts
    11
    I do have a date field, they are start day and end day.

    Maybe I am missing your point but the query is not based off the date. I just need all the events over a certain period of time (ex. Between 2200 and 0600) regardless of the date.

    Any additional explanation or help anyone can provide would be greatly appreciated.

    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Running Queries from a form
    By HaYuM in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:12 AM
  2. Combining Two Queries
    By csolomon in forum Queries
    Replies: 1
    Last Post: 09-03-2009, 01:33 PM
  3. Crosstab Queries
    By albst130 in forum Queries
    Replies: 0
    Last Post: 03-07-2007, 09:32 AM
  4. Queries the max from two rows
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 12-15-2006, 12:52 AM
  5. VBA and stacked queries
    By Pudy in forum Queries
    Replies: 0
    Last Post: 11-28-2006, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums