Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble with ORDER BY
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00776296
Message ID:
00776311
Views:
11
You should be able to add GROUP BY and ORDER BY DayField into you SELECT statement.

Stephen



>>SELECT (cast(datepart(mm,time) as varchar)+'/'+datename(dd,time)+'/'+datename(yyyy,time)) AS DayField,
>>COUNT(CondoDir) AS Hits FROM wwRequestLog
>>WHERE UPPER(CondoDir) LIKE 'FRANKLIN'
>>AND DATEDIFF(day, time, getdate()) < 14
>>GROUP BY (cast(datepart(mm,time) as varchar)+'/'+datename(dd,time)+'/'+datename(yyyy,time))
>>
>>
>>TIA
Stephen Lee

--------------------------------
Too much to code
Too little time
--------------------------------
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform