Results 1 to 3 of 3
  1. #1
    RickK is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    16

    Criteria to filter a specific date.

    I have a query that uses a criteria that looks like 'Between [enter beginning date] And [enter ending Date]". if I enter the beginning date of 6/01/2016 and the end date of 6/02/2016 it will show all records for 6/1/2016. I would like to reduce the amount of key strokes for the user by changing the criteria to only input the actual day date needed. So I would like to enter 6/01/2016 only and receive all records for that date.



    The problem is the field includes date and time. Everything I have tried has returned zero records. Is there a way to enter a wildcard like 6/01/2016*?

    What are my options?

    Thanks
    Rick

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Use a form, enter the date there by picking from the date picker.
    then the sql is

    select * from table where date between forms!frmMain!txtStartDate and forms!frmMain!txtEndDate

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    (UNTESTED but should give Date without time)
    Try DateValue(YourDateField)

    and if that doesn't work
    try
    DateValue(CStr(YourDateField))

    Good luck

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

Similar Threads

  1. Filter criteria by date
    By Xine in forum Queries
    Replies: 5
    Last Post: 03-24-2016, 11:08 PM
  2. Replies: 7
    Last Post: 01-05-2016, 11:23 AM
  3. Replies: 4
    Last Post: 12-17-2013, 08:31 AM
  4. Unbound Combobox Filter By Date Criteria
    By burrina in forum Forms
    Replies: 8
    Last Post: 01-04-2013, 02:24 PM
  5. Filter Using ComboBox For Date Criteria
    By burrina in forum Forms
    Replies: 12
    Last Post: 11-29-2012, 08:02 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