Check our online training feedbacks Here

24 April 2011

Extract Only Date from Date time field

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.

No comments :

Post a Comment

Your comments, Feedbacks and Suggestions are very much valuable to me :)