Follow-up Dates formulas

  • Thread starter Thread starter flipper
  • Start date Start date
F

flipper

Guest
How do I enter a formula/calculation in a table for follow up dates. I have a basic start date. In my form/table, I want the program to insert the following follow up dates automatically: one month, 3 month and 6 month.
 
I'm not an expert :) but it I had to do something, I would create a macro to do it. Not sure if that was helpful though. And if you need any help with that let me know.
 
Hi -

It's not considered good programming practice to store dates that can be calculated 'on the fly' with a query. If the original date were to change for any reason, then the calculated dates would be incorrect and you'd need to have another procedure to catch and fix the discrepancies.

As far as creating the calculation, you'd use the DateAdd() function. Here's a sample query that returns the 1,3 & 6 month dates, based on the OrderDate from Northwind's Orders table.
Code:
SELECT
    Orders.OrderID
  , Orders.OrderDate
  , DateAdd("m",1,[OrderDate]) AS OneMonth
  , DateAdd("m",3,[OrderDate]) AS ThreeMonth
  , DateAdd("m",6,[OrderDate]) AS SixMonth
FROM
   Orders;

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom