The following SQL Script helps to Extract only Date from DateTime field, it will ignore the time and display as "00:00:00.000".
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
Here I used the GetDate() function. In the Same way, we can use any datefield column.
There are other ways also there, but datatype and Dateformat is differentSelect convert(varchar, getdate(), 101)
Select convert(varchar, getdate(), 102)
Select convert(varchar, getdate(), 103)
Select convert(varchar, getdate(), 104)
Select convert(varchar, getdate(), 105)
Select convert(varchar, getdate(), 106)
Select convert(varchar, getdate(), 107)
No comments:
Post a Comment