how to get only date from getdate in sql code example
Example 1: sql getdate date only
-- MS SQL Server
SELECT CAST(getdate() AS date);
SELECT CAST(getdate() AS varchar(10));
Example 2: sql DATE = GETDATE()
CAST(GETDATE() AS DATE)
-- MS SQL Server
SELECT CAST(getdate() AS date);
SELECT CAST(getdate() AS varchar(10));
CAST(GETDATE() AS DATE)