get current week
-
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. :)
Haven't tried it, but I pasted this from a google search: SELECT * FROM YourTable WHERE DATEPART(WK, YourDateColumn) = DATEPART(WK, GETDATE()) Don't know if you can adjust what the starting/ending days are or not. Might ask in the SQL forum.
- S 50 cups of coffee and you know it's on!
-
Haven't tried it, but I pasted this from a google search: SELECT * FROM YourTable WHERE DATEPART(WK, YourDateColumn) = DATEPART(WK, GETDATE()) Don't know if you can adjust what the starting/ending days are or not. Might ask in the SQL forum.
- S 50 cups of coffee and you know it's on!
thanks a lot steve... this piece of code has made my things so simple.... it works like a charm.... :-D --Naina
--Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)