Results 1 to 6 of 6
  1. #1
    ry94080 is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2019
    Posts
    29

    Access Query Greater than Today at 05:00 am

    Hi all,



    This is probably an easy one. But i wanted to know what would be the easiest way to setup a query on a date field that will capture all date values that are greater than today, datevalue(now()). But also greater than 05:00am

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    It would likely be Date() + 5/24
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    ry94080 is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2019
    Posts
    29
    That appears to work in VBA. But when i enter that in a query field, it automatically converts to, ">=Date()+#5/24/2022#"

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Add the hours using a dateadd ?

    >DateAdd("h", 5, Date())

    https://docs.microsoft.com/en-us/off...teadd-function
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    ry94080 is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2019
    Posts
    29
    Perfect, thanks!

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Sorry, I only tested in the immediate window.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 3
    Last Post: 12-17-2017, 02:29 PM
  2. Greater Than in Query
    By rplum in forum Queries
    Replies: 7
    Last Post: 04-19-2016, 09:33 AM
  3. Replies: 5
    Last Post: 03-12-2015, 05:13 AM
  4. Greater than query
    By noobaccess in forum Access
    Replies: 5
    Last Post: 12-05-2012, 09:18 PM
  5. Replies: 5
    Last Post: 10-12-2012, 11:00 AM

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