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

Returning First Day of Current Year

Status
Not open for further replies.
Dec 11, 2009
60
US
I have a formula that I have created:

checkdate between '2010-01-01' and (Select checkdate from prcheckheader where checknumber = @checknumber)

I don't want to have to remember to change ('2010-01-01' )
to always be the first of the year? How can I write the date so it always picks up the first day of the current year?

Thanks!
 
Have a look at DATEPART() and GETDATE() functions. You can extract the year and leave the 01-01 static.

Beir bua agus beannacht!
 
There are several FAQ on dates

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top