Jag Kandasamy
“The only way to do great work is to love what you do ~ Steve Jobs"
Friday, January 20, 2012
First date of a week using SQL
How to get the first date / day in a week using SQL Server.?
The example gets the date of the first day in the week that GETDATE() is in.
SELECT DATEADD(ww, DATEDIFF(ww,0,GETDATE()), 0)
It's yery simple and quite elegant, Happy Coding!! :)
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)