Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    1

    Unanswered: Filtering records by time range and weekends days

    Hi,

    I am a novice user in MS Access. I have table with following fields:

    Record_ID
    Serial_Number
    Date_of_call
    Time_of_call
    Duration_of_call
    Cost_of_call

    My Date and time formats are "22-07-02" and "11:54:20 AM", respectively.

    Now I want to filter above data by pulling records where "Time_of_call" in range of 12:01:00 AM (mid-night) to 06:59:00 AM, and "Date_of_call" is weekends only.

    Sounds very difficult for me but I am sure there are clever guys in this Forum who might help me.

    Thanks for your time and valuable advise.

    Nadeem

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if you defined your Date_of_call and Time_of_call fields as anything other than date/time data types, you will have great difficulty in getting what you want

    for the filter, you can use

    where hour(datetimefield) between 0 and 6

    for the weekend test, you can use

    where weekday(datetimefield) in (1,7)

    but these will work only if you used a proper datetime field (combining Date_of_call and Time_of_call, probably)

    see Microsoft Access Misc. Tips

    rudy
    http://rudy.ca/

Posting Permissions

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