SQL SERVER - Retrieve - Select Only Date Part From DateTime - Best Practice - Part 2
Posted by: Journey to SQL Authority with Pinal Dave,
on 18 Oct 2008 |
View original | Bookmarked: 0 time(s)
A year ago I wrote post about SQL SERVER - Retrieve - Select Only Date Part From DateTime - Best Practice where I have discussed two different methods of getting datepart from datetime.Method 1:SELECT DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()))Method 2:SELECT CONVERT(VARCHAR(10),GETDATE(),111)I have summarized my post suggesting that either method works fine and I prefer to [...]...