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 WHERE

Rows with a DateTime in the past Time based condition Argument can be: MICROSECOND SECOND MINUTE HOUR DAY WEEK MONTH QUARTER YEAR

Read More

DateTime SELECT

Get time difference between now and a DateTime field Argument can be: MICROSECOND SECOND MINUTE HOUR DAY WEEK MONTH QUARTER YEAR If DateTime value is Null? You will get a Null value returned from TIMESTAMPDIFF Specifying Returned Date Format

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