Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My 'sort by week' has flaw
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
My 'sort by week' has flaw
Miscellaneous
Thread ID:
00818062
Message ID:
00818062
Views:
69
I'm sorting and grouping by week using this syntax:

GROUP BY CONVERT(varchar(10), [time] - DATEPART(dw, [time]), 101)

But I'm finding data from the previous year at the end of my result set, instead of at the beginning.

How can I include the year to make it sort properly...

TIA
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform