where date sql code example
Example 1: how to search date in sql query
select * from test
where date between '03/19/2014' and '03/19/2014 23:59:59'
Example 2: how to update date value in sql
UPDATE TABLE
SET EndDate = CAST('2009-05-25' AS DATETIME)
WHERE Id = 1
Example 3: 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 4: how to search date in sql query
select * from test
where datediff(day, date, '03/19/2014') = 0