View Single Post
  #2  
Old June 3rd, 2010, 09:40 PM posted to microsoft.public.access
Jörn Bosse[_3_]
external usenet poster
 
Posts: 20
Default Calculating time

Am 03.06.2010 21:23, schrieb Dave:
I have a single table database that has a drop down box of 60 days, 90 days,
and 180 days.

I want to calculate to time from the date of entry in the database to count
down from the days that was selected in the drop down box.

How would I go about doing this please be detailed and if you can include a
simple of the code that I would need in order to complete the task.


Hi,

if you want to do so, you could use the DateAdd-Function.
I would use it in a query.
You have the fields: Date1,Interval,Date2 in your table1

And the query hast to look like this:
SELECT Table1.Date1, Table1.Interval,
DateAdd('d',table1.Interval,table1.Date2) AS Date2
FROM Tabelle1;

The 'd' is for the intervaltype - d for day
The 2nd operator is the intervall, hier you have to select your values
from the combo box
The last operator is the startdate.

Regards
Jörn