Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
soofihussain
Starting Member
11 Posts |
Posted - 2015-04-30 : 03:36:41
|
I want to convert date to week consider saturday is first day of week and friday is end of week. for input is orderdate and output should be week. example orderdate 11.04.15 to 17.04.15 week should be 16. orderdate 18.04.15 week should change to 17. can you provide the solution for this Order Date Week11-Apr-2015 1612-Apr-2015 1613-Apr-2015 1614-Apr-2015 1615-Apr-2015 1616-Apr-2015 1617-Apr-2015 16Order Date Week18-Apr-2015 17 |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2015-04-30 : 04:06:56
|
select datepart(week,dateadd(day,1,'18-Apr-2015')) |
|
|
soofihussain
Starting Member
11 Posts |
Posted - 2015-04-30 : 04:10:48
|
order date is multiple rows of order date not only one date (18-04-15) |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-04-30 : 08:52:22
|
quote: Originally posted by soofihussain order date is multiple rows of order date not only one date (18-04-15)
what does that mean? AFAIK a date is a date. It cannot be multiple dates. |
|
|
|
|
|