retrieve current week's data
-
Hi all, Is there any way to get current weeks detail frm the database using SQL 2000?? For e.g. today is wednesday, i want all data from monday to sunday. Plz can anyone help in this
--Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)
-
Hi all, Is there any way to get current weeks detail frm the database using SQL 2000?? For e.g. today is wednesday, i want all data from monday to sunday. Plz can anyone help in this
--Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)
-
DATEPART() function should solve your problem Ex.
WHERE DatePart(wk, Convert(DateTime, ColA)) = DatePart(wk, Convert(DateTime, getdate())) AND Year(ColA) = Year(GetDate())
Regards KP
Thanks Krish.. It worked....
--Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)