A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculating number of days from input.



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2010, 08:17 PM posted to microsoft.public.access
Dave
external usenet poster
 
Posts: 2,331
Default Calculating number of days from input.

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.
  #2  
Old June 4th, 2010, 08:33 PM posted to microsoft.public.access
Jörn Bosse[_3_]
external usenet poster
 
Posts: 20
Default Calculating number of days from input.

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
  #3  
Old June 4th, 2010, 08:46 PM posted to microsoft.public.access
Daniel Pineault
external usenet poster
 
Posts: 658
Default Calculating number of days from input.

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.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.