Results 1 to 4 of 4
  1. #1
    weadwaker is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    new london
    Posts
    1

    I need a 90 day reminder

    I need to have a 90 day reminder in my data base. I work hazardous waste and we have a date that starts when the waste is created. I need to have a reminder to alert me that the specific waste is within 90 days of the 1 year date.
    Thanks in advance.
    Dave

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    have a form that runs a query for all records with
    SELECT *
    FROM myTable
    WHERE datediff("d", now(), [hazardDateCreated]) >= 275

  3. #3
    nurul is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    37
    hye,

    can u help me by explain about what is ("d", now(), [hazardDateCreated]) >= 275??
    your help much appreciate

    tq in advance..

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You can look up definitive help on the DateDiff Function in Access Help, but basically it calculates the difference in a given time/date 'Interval' between two dates.

    In the above, the Interval is "d," the designation for 'days.'

    The next two arguments are the Dates to be used in the calculation: Now and hazardDateCreated.

    Now() is a Function that returns the Current Date and Time, per your computer's clock. Since we're only dealing with days, here, I'd use Date() instead, which only returns the Date. I'll explain this below.

    The [hazardDateCreated] is the name that the Court Jester, above, gave to the DateTime Field you used to record when the hazard was created. When using this code, you'd need to replace it with the actual name of your Field.

    So, in plain language, if the difference between the day the hazard was created and the Current Date is equal to or greater than 275 days, you are within 90 days of the creation date's anniversary, and you need to pop a warning.

    Now for the Now/Date explanation:

    Using Now(), unless there is a valid need for having the Time portion of the DateTime, is a bad idea. For instance, if a Value of a Field, was entered, by code, with Now(), and later you needed to compare that Value with the Current Date, it being assigned using Date() or 9/25/2012, you would only get a match if your second code did the comparison at the exact same Date/Hour/Minute/Second as your original code, using Now() was run. This is because when you only enter the Date Portion in a DateTime Field, Access automatically adds on Midnight as the Time Portion.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. send email reminder
    By azaz in forum Forms
    Replies: 1
    Last Post: 12-26-2010, 08:35 AM
  2. advance date reminder
    By Denis in forum Database Design
    Replies: 1
    Last Post: 11-14-2010, 07:40 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