SELECT COUNT(*) AS Orders, CONVERT (VARCHAR(10), order_date, 103) AS Expr1 FROM tblFixedLine_order_summary WHERE (order_date BETWEEN GETDATE() - 100 AND GETDATE()) AND (status IS NULL) GROUP BY CONVERT (VARCHAR(10), order_date, 103) ORDER BY MONTH(CONVERT (VARCHAR(10), order_date, 103))
The code above works fine locally using VS2005 but when i upload this to my liver server which i believe is SQL 2005 ....
Column name 'tblFixedLine_order_summary.order_date' is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.
EDIT: I now realise you use spaces now anyway I could hae sworn you used to be a tabber
Correct - My name is pootle and I used to be a tabber. In fact, you werer the one that put me on to the "use spaces" trick.
It was specifically the right aligning of the clause keywords I was enquiring about from Rudy Tuesday.