Results 1 to 3 of 3
  1. #1
    harryklein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    48

    select dates from timestamp field

    Hi,



    I have a table, which has a date field, which has the timestamps of the entry date of the rows.
    I am trying to assembe a select query which returns the records entered on a given day, but I cannot figure out the right way.
    I thought using "like" would be ok, but it seems, it isn't.

    The query is something like this:
    Code:
    SELECT * FROM bookings WHERE eTime like "01/08/2017*"
    What's wrong with this?
    Thank you

  2. #2
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    A timestamp will have a date AND time element something like 01/08/2018 13:04:55
    All times and dates are stored in access as a decimal number where the integer part represents the day and the fractional part the time. Hence your wildcard not working. Like is used for strings.

    In order to get the date value you can use a number of methods but the simplest method is to use the DateValue([YourDateField]) which will return just the date portion.

    Alternatively you could use >=#01/08/2018# AND <#02/08/2018# to capture everything from the 1st of the August. (Assuming British date format)

    Lots more date related stuff here : http://allenbrowne.com/ser-36.html
    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 ↓↓

  3. #3
    harryklein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    48
    Thanks a lot for your answer, this is what I need.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-03-2017, 02:12 PM
  2. Select Records based on dates or no dates or both
    By usatraveler in forum Queries
    Replies: 3
    Last Post: 08-12-2016, 07:52 AM
  3. Replies: 3
    Last Post: 11-12-2014, 05:31 PM
  4. Timestamp based on a field only
    By gaker10 in forum Access
    Replies: 13
    Last Post: 07-28-2014, 12:35 PM
  5. converting timestamp to normal dates
    By shmuel in forum Access
    Replies: 8
    Last Post: 11-06-2013, 03:39 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