New to SQL server and was wondering if the following snipit of code can be done. I would like to name the column in the query to the month with the AS statement. Thanks in advance.
SUM(CASE WHEN datepart(MONTH, (DATEADD(M, - 1, GETDATE())))= DATEPART(MONTH, dbo.ACTION.ACTION_DATE) THEN 1 ELSE 0 END) AS datepart(MONTH,(DATEADD(M, - 1, GETDATE()))),
SUM(CASE WHEN datepart(MONTH, (DATEADD(M, - 1, GETDATE())))= DATEPART(MONTH, dbo.ACTION.ACTION_DATE) THEN 1 ELSE 0 END) AS datepart(MONTH,(DATEADD(M, - 1, GETDATE()))),