Need to return zero''s in the TIME portion of this date

  • Need to return zero's in the TIME portion of this DATE:

    select

    dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate() ), 0))

    (this query returns the LAST day of LAST year)

    BT
  • Why subtract 3 milliseconds (thereby generating a time component) if the stated goal is ... no time component ?

    select DateAdd(dd, -1, DATEADD(yy, DATEDIFF(yy,0,getdate() ), 0))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply