Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Date Function

Status
Not open for further replies.

Ninabunny

Programmer
Jul 24, 2000
70
US
I am using a simple =Now() date function with the format as yyyy. Problem is this, and I know it is something simple but it is evading me!
How do I calculate that date which is this year to show last years date? =Now()-1 comes up with the day.....help!!
I know I am close...
 
Look at the DateAdd function. I think it is:

DateAdd('yyyy', Date(), -1) Terry M. Hoey
 
Hi Folks,

th3856 was right with DateAdd Function, but the last 2 arguements are the wrong way round. should be:-

DateAdd("yyyy", -1, Date)

Codefish
 
Thanks CF. I didn't go look and was going from memory. Terry M. Hoey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top