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 |
|
ujjwol38
Starting Member
1 Post |
Posted - 2008-08-09 : 13:37:41
|
| Hi I run the following query and end up getting the error " Msg 102, Level 15, State 1, Line 2Incorrect syntax near 'order'." Can anybody help me with thisThe Query: SELECT empid, CONVERT(VARCHAR(7), ordmonth, 121) AS ordmonth, qty, SUM(qty) OVER(PARTITION BY empid ORDER BY ordermonth) AS runqtyFROM dbo.EmpOrders; |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-09 : 14:15:17
|
| you cant use ORDER BY clause with aggregate functions like SUM(),COUNT(),... |
 |
|
|
|
|
|