get only date sql code example
Example 1: sql datetime as date
SELECT
CONVERT(DATE, GETDATE()) date;
Example 2: sql getdate date only
-- MS SQL Server
SELECT CAST(getdate() AS date);
SELECT CAST(getdate() AS varchar(10));
SELECT
CONVERT(DATE, GETDATE()) date;
-- MS SQL Server
SELECT CAST(getdate() AS date);
SELECT CAST(getdate() AS varchar(10));