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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need function to get programmatically get the first of the year

Status
Not open for further replies.

Fiat77

Programmer
Joined
Feb 4, 2005
Messages
63
Location
US
Based on Date() I need to get the first of the year 10 years ago to use as a criteria in my query

So for example for today's Date() I need it to get back 1/1/1995.

I was trying to think of how to use DateAdd or DateDiff with the Date function but wan't sure how

Thanks

 

Hi,

Code:
dateserial(year(MyDate)-10, 1, 1)

Skip,

[glasses] [red]Be advised:[/red]We know Newton's 3 Laws. But did you hear about the [red]FOURTH???[/red]
Only ONE fig per cookie![tongue]
 
Thanks a lot Skip!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top