PC Review


Reply
Thread Tools Rate Thread

Calculating number of days from input.

 
 
Dave
Guest
Posts: n/a
 
      4th Jun 2010
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.
 
Reply With Quote
 
 
 
 
Jörn Bosse
Guest
Posts: n/a
 
      4th Jun 2010
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
 
Reply With Quote
 
Daniel Pineault
Guest
Posts: n/a
 
      4th Jun 2010
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.



"Dave" wrote:

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating number of days off cathy Microsoft Excel Programming 7 10th Jun 2008 10:05 PM
Calculating number of days =?Utf-8?B?Y3J5Ymlja2k=?= Microsoft Access Getting Started 5 30th Nov 2005 09:34 AM
Calculating number of days Carlos Microsoft Excel Worksheet Functions 3 1st Mar 2005 08:23 PM
Calculating Number of days Bill Microsoft Access Getting Started 2 13th Jan 2004 07:26 PM
calculating number of days Humbertt Microsoft Excel Worksheet Functions 2 21st Nov 2003 05:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:52 AM.