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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Query criteria (records since 8am yesterday) (A2k)

    Author
    Topic
    #427614

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #991253

      Try

      >DateAdd(“h”,-16,Date())

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

      • #991274

        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)?

        • #991275

          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.

      • #991364

        Sorry for the delayed feedback – that works great. Thank you.

    Viewing 0 reply threads
    Reply To: Query criteria (records since 8am yesterday) (A2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: