Select error
SELECT 4 AS SlNo, c.clientName AS Perticular ,NULL,convert(nvarchar(75),a.dr) AS Amount
FROM dbo.Accounts a LEFT OUTER JOIN dbo.client c ON a.client_id=c.clientId WHERE c.cltGroupId='5' ,null,null,null
This is my select query but the following error occur
Msg 102, Level 15, State 1, Line 25
Incorrect syntax near ','.


Mamta MRank #268 · 9.4K reputationPosted Aug 4, 2011, 1:25 AM EDT
Shouldnt you be using AND to combine multiple conditions in a WHERE clause?
Zoran HorvatRank #792 · 2.9K reputationPosted Aug 4, 2011, 1:25 AM EDT
This is the problem. You should format WHERE clause better. Question is how did you create this ,null,null,null part.
Zoran
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Aug 4, 2011, 1:42 AM EDT
i think here you gone wrong...
WHERE c.cltGroupId='5',null,null,null ( i want to know the meaning of this...)
Most of the case Id's are integers ...if that is true in your case also
just write your where clause like WHERE c.cltGroupId=5
check your datatype of cltGroupId column once...
refer this Link to know more about Where Clause
hope this help you......
Suthish NairRank #92 · 22.8K reputationPosted Aug 4, 2011, 11:37 AM EDT
Mahesh ChandRank #1 · 393.3K reputationPosted Aug 4, 2011, 4:57 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Aug 5, 2011, 11:43 AM EDT