Calculating future Dates in a form to be stored in a table.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nosobright
    New Member
    • Jul 2012
    • 1

    Calculating future Dates in a form to be stored in a table.

    I am a beginer. I have been tasked at projecting failure dates of Batteries. Batteries have different failure rates. So when we install a battery "Change Date" and the known life is 3 yrs "Failure Time", I need that result to show up in a "Failed" date field. If a battery has a 10 year life, I need that to show up in the Failure Date field.
    I cold see an expression in the "failed" field like =([ChangeDate]+[failureTime]) but it does not work. How stupid am I?
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Are the failure rates always in years? If so, what I would do would be to have a Change_Date field and a Failure_Rate field in the table. You would then use a query to calculate the actual failure date. I do it this way because you aren't supposed to store calculated fields (read Database Normalization and Table Structures for the reason).

    Your query would work like this:
    Code:
    SELECT Change_Date,
    Failure_Rate,
    DateAdd("YYYY",Failure_Rate,Change_Date) AS Failure_Time
    FROM table_name
    You can then base your forms or reports on this query.

    Comment

    Working...