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

DATES

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I need to run a query to get results for a field for last 12 months. I am using getdate and DATENAME. But I am having problem converting Int TO VarChar.Besides how do I do a While for 12 months? PLs Suggest.
 
Why DATENAME and not DATEPART?<br>Note that GETDATE() returns a time value as well, so either convert it to a string to drop the time or be aware that you are checking for dates between datetime values. <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top