Results 1 to 3 of 3
  1. #1
    DelbyJones is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    11

    IIf Query with dates

    This forum saved my life once before. Here goes one more time.

    I have a date field in table. Some entries are blank, others have a date entered. That date is either expired or not. My expiration date is 10/10/2012.



    I want a query with a column that returns “no” if the field is either blank OR if the field is before 10/10/2012, and “yes” if it’s 10/10/2012 or after.

    I’m having trouble writing an IIf expression for that, I think it's because of the "or" in my criteria. Can someone help me?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How about this:
    Code:
    Expired: iif(DateValue(nz([MyDate],"1/1/2000"))<datevalue("10/10/2012"),"no","yes")

  3. #3
    DelbyJones is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    11
    That worked, Joe. I can stop banging my head on the desk. Can't thank you enough!!!

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

Similar Threads

  1. 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
  2. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  3. Run Query by dates
    By BorisGomel in forum Access
    Replies: 3
    Last Post: 07-21-2011, 03:54 PM
  4. Query with Dates as Numbers
    By forrestapi in forum Queries
    Replies: 9
    Last Post: 04-05-2011, 08:46 AM
  5. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 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