How to get only date from data field SQl server t- sql

Following line gives you the short date  from long date time field. ie. From a date time field of Sql server field if you need to extract only date use the the following method. Replace GetDate() with your date field name.

Cast(Floor(Cast(Getdate() as float)) as datetime

Tags: , , ,

Comments are closed.