SELECT COUNT(*) AS TotalRecords FROM Expenses WHERE ([YEAR](PostDate) = [YEAR](@MyDate)) AND (MONTH(PostDate) = MONTH(@MyDate))
SELECT COUNT(*) As [TotalRecords] --or "TotalRecords" FROM Expenses WHERE YEAR(PostDate) = YEAR(@MyDate) AND MONTH(PostDate) = MONTH(@MyDate)
Quote:Parser Fix: Does not correctly parse certain 3-part column names like: [dbo].[MyTable].ColumnName Parser Fix: SELECT improperly accepts other unquoted keywords as table or column alias and thus can fail to recognize the start of a new statement when an optional alias can follow if no semicolon is used to separate them.
[dbo].[MyTable].ColumnName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)