That only goes to the current month, use this:
DECLARE @startDate DATETIME
------------------------------------------------------------------------------------------
SET @startDate = CAST(CAST(DATEP ART(yyyy,GETDAT E()) AS VARCHAR(8)) +
'01' + '01' AS DATETIME)
------------------------------------------------------------------------------------------
--Whatever the parameter is you want...
User Profile
Collapse
-
DECLARE @startDate DATETIME
------------------------------------------------------------------------------------------
SET @startDate = CAST(CAST(DATEP ART(yyyy,GETDAT E()) AS VARCHAR(8)) +
RIGHT('0' + CAST(DATEPART(m m,GETDATE()) AS VARCHAR(8)),2) +
'01' AS DATETIME)
------------------------------------------------------------------------------------------
--Whatever the parameter is you want...Leave a comment:
No activity results to display
Show More
Leave a comment: