So there's some disagreement at my work recently about which is the best way to take the month from getdate()
(or alternatively from a datetime column).
There are two ways I know of that are fairly standard for doing this:
Method #1:
select DateAdd(Day, 0, DateDiff(Day, 0, Getdate()))
And Method #2:
select Cast(Floor(Cast(Getdate() as Float)) as Datetime)
I'm a big fan of method #2 as I find it much easier to internalize as well as being (slightly) faster. However, I've been told that method #1 is the standard way of doing this. My question is why? Which of these two would I be best served having as the method for taking a month from a date in my arsenal and why?