Reputation: 21
My query is
SELECT SUM([CurrentAmount]) AS SUMS, Description
FROM [PR_ABT]
WHERE CheckDate = 12/27/2019
GROUP BY Description
I am getting the following error
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'WHERE'
Upvotes: 0
Views: 26
Reputation: 754408
Date as string literal must be in single quotes! And preferably, use the ISO-8601 format YYYYMMDD
which is language independent - so try:
SELECT SUM([CurrentAmount]) AS SUMS, Description
FROM [PR_ABT]
WHERE CheckDate = '20191227'
GROUP BY Description
Upvotes: 1