Results 1 to 3 of 3
  1. #1
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23

    Query stops working when I add criteria to one of two date fields

    I'd appreciate any help I could get on this one, it has me scratching my head. I'm not entirely new to access or SQL but I don't have a huge amount of experience.


    I have a table (appointments) that contains two different date fields. ApptDate_1 is for one type of appointment, ApptDate_2 is for a different type of appointment.



    I have a query to gather data to put into a report. Both ApptDate1 and ApptDate2 are required to be displayed in different areas of this report, so the query looks for both. There is no problem with the query until I try to set criteria for ApptDate1 or ApptDate2.

    I want to set the criteria >=Date() on both date types, so that I only see future appointment dates, however, when I set this on either ApptDate1 or ApptDate2, the query only returns appointments of that date type. When I set it on both date types, the query doesn't return any results at all.


    Can anybody please tell me why this is happening? Or how to get around this problem?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Put the criteria for each date on a different row in the designer so that the criteria date1 or date2 rather than date1 and date2
    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
    AdiDoyle is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    Ireland
    Posts
    23
    Hey, of course. That worked perfectly. I don't know why I was being such a muppet, but I thought doing that would still show appointments that occurred before the current date.

    Thanks a million.

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

Similar Threads

  1. Working query stops working after importing
    By Abacus1234 in forum Import/Export Data
    Replies: 3
    Last Post: 10-25-2015, 09:12 PM
  2. Replies: 7
    Last Post: 08-31-2015, 12:53 PM
  3. Replies: 3
    Last Post: 06-26-2015, 09:40 AM
  4. Append Query Stops Working in RunSQL Command Question
    By McArthurGDM in forum Programming
    Replies: 6
    Last Post: 06-11-2015, 11:17 AM
  5. Date Picker Stops Working In Ms Access 2010
    By ranjhanisaddam in forum Access
    Replies: 1
    Last Post: 09-16-2013, 12:53 AM

Tags for this Thread

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