Results 1 to 4 of 4
  1. #1
    excellenthelp is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    93

    QUERY: Date/Time with a wild card as criteria?

    Hello Accessors,

    How may I write a criteria in the query where I can pull records with date/time data type (01/31/15 1:30:23 PM) based on today's date?



    Example using today's date (4/21/15):

    Date()= 4/21/15

    The query will pull these records:
    ABC 4/21/15 9:14:40 AM
    DEF 4/21/15 10:50:02 AM
    GHI 4/21/15 2:32:35 PM
    etc.

    The time does not matter as long as the date is 4/21/15.

    I have tried using these formulas:
    =Date() & *
    =Date(Now)

    but these are no success.

    Help?

    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Wildcard really only works with text data and LIKE operator.

    I am surprised the query returns records with time other than midnight.

    Create a field in query that extracts the date part and apply filter criteria to that constructed field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    excellenthelp is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    93
    Thanks June7!

    I have made a field with: Exp1: Format([Field],"M/DD/YYYY") and put =Date() in the criteria and the query could populate what I wanted!

    Marking this as SOLVED.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Change Exp1 to something more meaningful.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Time Card Query Issue (dateDiff)
    By ShostyFan in forum Queries
    Replies: 3
    Last Post: 01-05-2015, 06:20 PM
  2. Critera for date using wild cards
    By Ubberz in forum Queries
    Replies: 2
    Last Post: 04-02-2014, 12:36 PM
  3. Criteria from form to query with wild card
    By SteveW in forum Queries
    Replies: 3
    Last Post: 04-01-2011, 07:49 PM
  4. DoCmd.ApplyFilter with wild card
    By cksm4 in forum Programming
    Replies: 3
    Last Post: 10-05-2010, 08:24 AM
  5. Import with a wild card
    By ukgooner in forum Import/Export Data
    Replies: 3
    Last Post: 09-09-2009, 08:08 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