Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query criteria (records since 8am yesterday) (A2k)

    I have no clue how to format this query criteria, so I'm asking here. I have a change log table, I want to display all records since 8am yesterday. The field name is DATE_OF_CHANGE, formatted "yyyymmdd hh:mm". What would the criteria link look like? I suppose in layman's terms its >8am today - 24hrs...., but I don't know how to write it.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query criteria (records since 8am yesterday) (A2k)

    Try

    >DateAdd("h",-16,Date())

    Date() is today, midnight. By adding -16 hours, i.e. subtracting 16 hours, you get 8:00 AM.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Query criteria (records since 8am yesterday) (

    Right silly question here, but I need to just clarify with you.

    If the date is 20/12/05 will it be midnight(1 minute before 00:01) in the morning of that date or the nightime(1 minute after 23:59)?
    Jerry

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query criteria (records since 8am yesterday) (

    The former: 0:00 in 24 hour notation, 12:00 AM in AM/PM notation.
    In a "pure" date, the time component is 0, so the time is 0:00 or 12:00 AM.

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query criteria (records since 8am yesterday) (

    Sorry for the delayed feedback - that works great. Thank you.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

Posting Permissions

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