Displaying yesterdays date

JaredNJames

Registered User.
Local time
Today, 23:14
Joined
Jul 7, 2007
Messages
87
hi, i have a simple form with an unbound text field, which is used to input the date criteria for a query.

i want it so that next to the box there would be two buttons for "today" and "yesterday".

when you press today, it inputs todays date, and if you press yesterday i want it to input yesterdays.

for today i have used a simple code:
text12 = date()

but i cant work out how to do yesterday. i have tried:
text12 = date()-1
but it doesnt work.

any ideas?

jared james
 
hi, sorted now, incase anyone else needs it, it's simply:

= date() - (1)

jared james
 
You could also use DateAdd function and add a negative 1 :)
 
That should have worked. What did you get? Did it error?
 

Users who are viewing this thread

Back
Top Bottom