I am trying to learn dateadd and datediff. To get the first day of the month, we use below.
SELECT DATEADD(DD, DATEDIFF(DD, 0, GETDATE()), 0) AS [Date Part Only]
Why this alone select DATEDIFF(DD, 0, GETDATE()) returns 41911? And what this is , 0) at the end means?
DATEADD(datepart, interval, date)
DATEDIFF(datepart, start_date, end_date)