Incrementing a date

AnOddExperiment

Registered User.
Local time
Today, 05:58
Joined
Dec 10, 2007
Messages
20
Hi everyone, hopefully this one is easy for you all.

so if I have the follow code that works great...

Code:
Dim strDate as String
strDate = Date

and I want tomorrow's date saved to a variable as a string, how do I do that?

Code:
Dim strDate as String
Dim strTomorrow as String
strDate = Date
strTomorrow = ???

sadly there is no Tomorrow() function :)
 
Look in Access help for functions with Date. I think you want DateAdd(), but not positively sure. If you search with 'date function' you should get several hits.
 
Hi everyone, hopefully this one is easy for you all.

so if I have the follow code that works great...

Code:
Dim strDate as String
strDate = Date

and I want tomorrow's date saved to a variable as a string, how do I do that?

Code:
Dim strDate as String
Dim strTomorrow as String
strDate = Date
strTomorrow = ???

sadly there is no Tomorrow() function :)
I have just tested this. it worked!
strTomorrow= Date + 1
 
found it! Didn't even know about the DateAdd() function. Works like a charm. I'm shocked Date + 1 works also, it seems so simple. Thanks a ton!!
 
Dunno for me. That was the first thought that popped in my head, but I thought to myself, "Nah, that can't be that simple. It may only add seconds but not days." :o
 

Users who are viewing this thread

Back
Top Bottom