User Profile

Collapse

Profile Sidebar

Collapse
gentofnet
gentofnet
Last Activity: Aug 8 '06, 05:30 PM
Joined: Aug 8 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • gentofnet
    replied to Yeartodate
    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...
    See more | Go to post

    Leave a comment:


  • gentofnet
    replied to Yeartodate
    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...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...