後我想上使用此SQL查詢在此日期之後顯示的數據:SQL只顯示數據在此日期
SELECT
DATEPART(mm, [closedate]) AS [Month],
COUNT([opp]) AS 'Won Opportunities', SUM([actual]) AS 'Value'
FROM
[dbo].[tableName]
WHERE
[person] = 'Name'
AND Month([CreatedOn]) = 2015-08-01
GROUP BY
DATEPART(mm, [closedate])
但它似乎並不奏效。
這是錯誤:
Conversion failed when converting the nvarchar value ''2015-08-01'' to data type int.
你想限制數據到一個特定的月份,或者你想在指定的日期後的一切? – jpw
嘿@jpw,那個月和之後。 – AndroidAL