2
Good morning !
I am using the command below and the result returned is 6. In fact, looking at the dates, I haven’t exactly closed the 6 months, I think that through this function are not being considered the days, and this is causing me a problem. Would it have any way to return in this case only the integer 5 or even with decimal, 5.8 for example ?
SELECT CONVERT(VARCHAR(10), GETDATE(), 112), '20180222', DATEDIFF(MM, '20180222', CONVERT(VARCHAR(10), GETDATE(), 112))
20180817 20180222 6
is as you said, the scolding is accuracy (months with 28, 29 or 31 days may not bring the expected result)
– rLinhares