Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2015
    Posts
    1

    Tracking expiration dates 90 days, 30 days, expired and emailing each advisory


    I need a database for work that tracks expiration dates of DOT Physicals and Drivers License expiration dates. I need it to alert management when thresholds are reached. 90 days, 30 days, expired... Seems like it would be easy, but I have know clue how to accomplish this mission. I have attached what I have so far (Not a lot) any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    In a query Q1, calc the days to expire: Days2Exp: DateDiff("d",[expDate],date())
    In Q2, use Q1 using either an IIF statement or the funtion below to get the text result.

    Code:
    public Function calcExpStat(byval  pvDays)
    
    Select case pvDays
       Case < 1
              calcExpStat = "expired"
       Case < 60
               calcExpStat = "60days"
       Case < 90
              calcExpStat = "90days"
       Case else
             calcExpStat = ""
    end function

  3. #3
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    or use the choose function in a query (similar to a case statement)

    choose(DateDiff("d",[expDate],date())<1,"Expired",DateDiff("d",[expDate],date())<60,"60 Days",DateDiff("d",[expDate],date())<90,"90 Days")

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

Similar Threads

  1. Calculate days between two dates by VBA
    By hhuuhn12 in forum Programming
    Replies: 16
    Last Post: 12-10-2013, 03:11 PM
  2. Replies: 2
    Last Post: 11-04-2013, 10:55 AM
  3. Dates before 30 days
    By fabiobarreto10 in forum Queries
    Replies: 7
    Last Post: 04-20-2012, 12:11 PM
  4. Dates & Days Fields
    By djclntn in forum Database Design
    Replies: 5
    Last Post: 10-22-2011, 06:22 PM
  5. Select Dates between days and two days ago?
    By rstonehouse in forum Queries
    Replies: 4
    Last Post: 08-18-2010, 02:13 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