date from datetime sql code example
Example 1: sql datetime as date
SELECT
CONVERT(DATE, GETDATE()) date;
Example 2: sql day from datetime
SET @@lc_time_names = 'fr_FR';
SELECT DAYNAME('2000-01-01') dayname;
+---------+
| dayname |
+---------+
| samedi |
+---------+