Calculating number of days from input.

D

Dave

How do you calculate the number of days from the original date the the record
was recorded.

for example

You have a text box the has three options 90 day, 180 days, and 360 days.

And a date and time box to true to show the expiration date.

How do I get the database to show the to calculate the expiration date
depending on the number of days that was selected.
 
J

Jörn Bosse

Am 04.06.2010 21:17, schrieb Dave:
How do you calculate the number of days from the original date the the record
was recorded.

for example

You have a text box the has three options 90 day, 180 days, and 360 days.

And a date and time box to true to show the expiration date.

How do I get the database to show the to calculate the expiration date
depending on the number of days that was selected.

Well Dave as some of us already told you, you have to use the
dateadd-function.
Where do you want to calculate this new date? In a form or in a query?
If you use a form, tell me the names of the textfields and the combobox
and the rowsource of that combobox.

Regards
Jörn
 
D

Daniel Pineault

You can calculate the expiration date using the DateAdd Function

DateAdd(Interval As String, Number As Double, Date)

In your case, since you are talking about 90, 180 & 360 days you could use
the "d" interval, but you may also prefer to use the "m" interval (3, 6, 12)

DateAdd("m",3,date)
DateAdd("d",90,date)
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top