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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|