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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 * Incorrect syntax near , PLEASE Help **

Author  Topic 

dbserver2000
Starting Member

47 Posts

Posted - 2009-03-19 : 01:51:27


USE AdventureWorks ;
GO
SELECT SalesPersonID
SUM (TotalDue) AS 'Total Sales'
FROM Sales.SalesOrderHeader
GROUP BY SalesPersonID

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'TotalDue'.

Why am I getting this error?

Thanks

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-03-19 : 02:04:44
SELECT SalesPersonID,SUM (TotalDue) AS 'Total Sales'
FROM Sales.SalesOrderHeader
GROUP BY SalesPersonID
Go to Top of Page

dbserver2000
Starting Member

47 Posts

Posted - 2009-03-19 : 02:11:38
No way.
Just a simple comma

thanks, you are the best
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-03-19 : 02:53:38
welcome
Go to Top of Page
   

- Advertisement -