Date

Setting Date column to the current date Just use Now() as you would for a DateTime WHERE based on a date The same as for a DateTime column:

Read More

DateTime CREATE TABLE

Adding an auto fill row created at DateTime column For MySQL V5.6 and above you can do this: For earlier versions you must use timestamp and can only have 1 column defined as this:

Read More

DateTime SELECT

Date Order ASC = oldest firstDESC = most recent first Date or DateTime from strings Get time difference between now and a DateTime field Argument can be: If DateTime value is Null? You will get a Null value returned from TIMESTAMPDIFF Specifying Returned Date Format Get SQL Server’s Current DateTime Same as Now() but giving […]

Read More

DateTime general

ORDER BY Date Order ASC = oldest first DESC = most recent first Note it’s “MINUTE”, “HOUR”, etc not “MINUTES” or “HOURS” etc Convert DateTime to Date Specifying Date and DateTime from a string It is recommended to use CAST() Last Day Of Month (This produces a DATE result, not DATETIME) Get SQL Server’s Current […]

Read More