Results 1 to 6 of 6
  1. #1
    heynay01 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    9

    Show records if one date is greater than the other

    I have 2 tables I'm comparing in a query, each has a date field -QCDate in tbl1 and ReviewDate in tbl2. I need the query to only return records where the QCDate =< ReviewDate. How in the heck do I do this? I can't figure it out for the life of me.



    Thank you!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Hi

    You may like to try this:

    Put "=< ReviewDate" (without the quotes) in the WHERE line of the query, under "QCDate"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You also need to change it to

    <= [ReviewDate]

    as =< is incorrect syntax and will give you an error.

  4. #4
    heynay01 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    9
    FYI - syntax was just my typo in here.

    I tried <=ReviewDate before (and again just now) and I keep getting a pop-up message saying "Data type mismatch in criteria expression." Any ideas?

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by heynay01 View Post
    FYI - syntax was just my typo in here.

    I tried <=ReviewDate before (and again just now) and I keep getting a pop-up message saying "Data type mismatch in criteria expression." Any ideas?
    You need to include the square brackets around ReviewDate so it knows you are talking about the FIELD.

    <=[ReviewDate]

    as I showed. Otherwise, if that doesn't work then you need to check to make sure that they are both really date/time fields.

  6. #6
    heynay01 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    9
    Thank you! The problems was one of the fields was text - that table was made by another user so I never even thought of checking for that. Worked like a charm once I changed it

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

Similar Threads

  1. Greater than or equal to date
    By stryder09 in forum Access
    Replies: 1
    Last Post: 04-14-2011, 03:54 PM
  2. Aslways show Current Date even in Old records
    By farhanahmed in forum Programming
    Replies: 3
    Last Post: 04-03-2011, 12:56 PM
  3. Joins to get records greater than
    By thart21 in forum Queries
    Replies: 10
    Last Post: 09-15-2010, 08:45 AM
  4. Greater than date
    By I-am-me in forum Queries
    Replies: 1
    Last Post: 08-18-2009, 05:21 AM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 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