sql format date as datetime code example
Example 1: sql datetime as date
SELECT
CONVERT(DATE, GETDATE()) date;
Example 2: sql server convert string to date
Cast( '2011-07-07' as date ) as convertedDate
SELECT
CONVERT(DATE, GETDATE()) date;
Cast( '2011-07-07' as date ) as convertedDate