Results 1 to 7 of 7
  1. #1
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255

    date criteria is not working

    I dont know what the deal is with the date criteria.. I am still getting dates outside the date range i am asking for..

    SQL:

    SELECT HUMANIC_CPO_EMP_ALL.DIV_1_DESC, HUMANIC_CPO_EMP_ALL.DIV_2_DESC, HUMANIC_CPO_EMP_ALL.ENUMBER, HUMANIC_PERFHIST_MASTER.EFFDATE
    FROM HUMANIC_CPO_EMP_ALL RIGHT JOIN HUMANIC_PERFHIST_MASTER ON HUMANIC_CPO_EMP_ALL.SSN = HUMANIC_PERFHIST_MASTER.HSSN
    WHERE (((HUMANIC_PERFHIST_MASTER.EFFDATE)>#1/1/2009#))
    ORDER BY HUMANIC_CPO_EMP_ALL.DIV_1_DESC, HUMANIC_CPO_EMP_ALL.DIV_2_DESC;

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    WHERE (((HUMANIC_PERFHIST_MASTER.EFFDATE)>#1/1/2009#))

    so you're getting records where the EFFDATE on the table HUMANIC_PERFHIST_MASTER is prior or equal to 1/1/2009? You say you're getting records outside of your range but really you only have one endpoint, a range would be between two dates.

  3. #3
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    well i want records for dates newer than 1/1/2009 so i used >=#1/1/2009# and that didnt work, I was still getting dates from 2004. I tried >#1/1/2009# and <#4/2/2011# also and that didnt work either

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    are you storing this field as a text field? if so that's why

    try doing

    WHERE ((cdate(HUMANIC_PERFHIST_MASTER.EFFDATE)>#1/1/2009#))

  5. #5
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    EFFDATE is Date/Time...

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    can you upload a sample database with garbage data. If it's date time I don't understand how you would be getting items outside of your criteria.

  7. #7
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    i created a new test database and it worked in that one so I am going to redo this one i am working on.

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

Similar Threads

  1. Link Criteria no working when opening new form
    By ETCallHome in forum Forms
    Replies: 1
    Last Post: 06-17-2011, 05:26 AM
  2. Replies: 9
    Last Post: 05-05-2011, 02:05 PM
  3. Criteria for date due
    By Desstro in forum Queries
    Replies: 4
    Last Post: 11-30-2010, 12:54 PM
  4. Replies: 3
    Last Post: 10-13-2010, 03:35 PM
  5. Replies: 0
    Last Post: 04-08-2010, 12:22 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