Results 1 to 3 of 3
  1. #1
    shoggy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    2

    Query to match dates in two fields

    Hi,

    I'm trying to create a query which will match dates in two fields. Example I have Date Opened and Date Resolved. I want the query to return all fields which have the same Date Opened and Date Resolved. When I run at present I get nothing because there is a time attached to both dates.

    Thanks



    Shoggy

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    There are a number of ways of doing this. In Excel and Access, dates are actually stored as numbers (the number of days since 1/1/1900). So time represents a fraction of a day, and would be stored as decimal.
    So one way to remove the time component is to apply the INT (integer) function to the date, which removes the decimal (time portion).

    So in your Criteria of your query, something like this would work:
    Code:
    WHERE INT([Date1])=INT([Date2])

  3. #3
    shoggy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    2
    Thankyou very much. Works perfectly

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

Similar Threads

  1. Query for same fields, different dates
    By BCJourney in forum Queries
    Replies: 4
    Last Post: 07-08-2013, 01:29 PM
  2. Match Dates from two tables
    By GabyArco in forum Queries
    Replies: 2
    Last Post: 06-02-2013, 06:03 PM
  3. Match Table Fields
    By vinsavant in forum Access
    Replies: 1
    Last Post: 01-17-2013, 12:06 AM
  4. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  5. Replies: 3
    Last Post: 08-05-2011, 08:13 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