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 ','.

Suthish NairPosted Aug 5, 2011, 3:43 PM
Mahesh ChandPosted Aug 4, 2011, 8:57 PM
Suthish NairPosted Aug 4, 2011, 3:37 PM
Jiteendra SampathiraoPosted Aug 4, 2011, 5:42 AM
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......
Zoran HorvatPosted Aug 4, 2011, 5:25 AM
This is the problem. You should format WHERE clause better. Question is how did you create this ,null,null,null part.
Zoran
Mamta MPosted Aug 4, 2011, 5:25 AM
Shouldnt you be using AND to combine multiple conditions in a WHERE clause?