• Grant Fritchey (9/5/2014)


    So, Eirikur, if you used DATE instead of DATETIME would that also solve the issue? Just asking. I don't know MySQL from MyElbow.

    It is more a question of the functions used to retrieve the current date or date and time. This can be somewhat confusing. In MySql/MariaDB there are 3 main "timestamp" functions:

    CURDATE(), current date to the day.

    NOW(), date and time to the second at the start of batch execution, deterministic in the scope of the batch.

    SYSDATE(), date and time to the second at the time of execution, non-deterministic in the scope of the batch.

    Data types

    DATE, almost the same apart from the range of 1000-01-01 to 9999-12-31

    DATETIME almost the same apart from the range is 1000-01-01 00:00:00 to 9999-12-31 23:59:59

    TIMESTAMP, similar to SMALLDATETIME with the range of 1970-01-01 00:00:01 to 2038-01-19 03:14:07

    😎