date data type in sql code example
Example 1: sql datetime as date
SELECT
CONVERT(DATE, GETDATE()) date;
Example 2: date datatype in sql
DATE - format YYYY-MM-DD
DATETIME - format: YYYY-MM-DD HH:MI:SS
TIMESTAMP - format: YYYY-MM-DD HH:MI:SS
YEAR - format YYYY or YY
Example 3: sql server date field syntax
DATE - format YYYY-MM-DD