Results 1 to 2 of 2
  1. #1
    wnicole is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    118

    IIF statement in Date calculations


    I tried this Between (Date()+7) And Date()

    but was wondering how do I write this in an IIF statement.

    I want to get a text field going for example:
    IIF Between (Date()+7) And Date() THEN "Certification Alert"

    Can you assist?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    IIf is a function used in expressions. If Then is conditional code structure used in VBA and macros.

    Where do you want this? In a query:

    SELECT *, IIf([fieldname] Between Date() And Date() + 7, "Certification Alert", Null) AS Status FROM tablename;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. date calculations in a form field
    By Csalge in forum Forms
    Replies: 3
    Last Post: 03-30-2013, 02:54 PM
  2. date/time field calculations
    By donnan33 in forum Queries
    Replies: 4
    Last Post: 01-13-2012, 11:58 AM
  3. Replies: 7
    Last Post: 09-12-2011, 12:03 PM
  4. Date Calculations
    By Polarbilly in forum Forms
    Replies: 2
    Last Post: 06-01-2011, 12:55 PM
  5. Date calculations
    By NOTLguy in forum Access
    Replies: 10
    Last Post: 10-09-2010, 06:41 AM

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