Results 1 to 7 of 7
  1. #1
    jlmnjem is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2006
    Posts
    9

    Field content based on date calculation


    I have a field in a table that contains the expiration date of my contractors' insurance certificates. I would like to have a field that returns a "Current" or "Expired" value based on whether the current date is before or after the expiration date. How would I do this?

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    select expired:[expiration date]< now() from ...

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    In a query, form or report:

    IIf(ExpirationDate <= Date(), "Current", "Expired")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    jlmnjem is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2006
    Posts
    9
    Can this be done in the table itself?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No; storing calculated values is not typically done anyway.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    jlmnjem is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2006
    Posts
    9
    OK, thanks!

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. lost - linking date field based on a record with smaller Unique ID
    By stan.chernov@gmail.com in forum Queries
    Replies: 7
    Last Post: 09-16-2010, 02:22 PM
  2. Replies: 2
    Last Post: 07-26-2010, 11:28 AM
  3. Replies: 2
    Last Post: 03-03-2010, 07:37 AM
  4. duplicate record based on calculation
    By Coolpapabell in forum Queries
    Replies: 4
    Last Post: 08-06-2009, 07:53 AM
  5. Date Calculation ?
    By techexpressinc in forum Queries
    Replies: 2
    Last Post: 06-24-2009, 09:02 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