Welcome To Snipplr


Everyone's Recent MySQL Snippets Tagged date



« Prev 1 Next »
Created as reply to question on ittoolbox.com:"Need your help in writing a query to pull audit history i.e. Last updated by a user 'XYZ' and for the same record key (ID) the second last record in the audit history table. i.e. Last update by this user...
0 115 posted 5 years ago by bvwatson
Converts textual dates like '1-3-1954' and '01-02-1963' to respectively '1954-3-1' and '1963-02-01'. MySQL is smart enough to understand the values without leading zeros when inserting into a DATE field.
0 95 posted 8 years ago by jpkunst
The datetime_field value in the database is '0000-00-00 00:00:00'.
0 59 posted 9 years ago by dsoms
I use something similar to the example to get the difference between statuses in a status log table that I have. It comes in handy when determining the number of days between status changes. This works in MySQL 5.0.
0 128 posted 10 years ago by bradless
It's not 100% accurate, but works fine for people under 1.480.
2 115 posted 10 years ago by nkm
2 80 posted 11 years ago by craig1709
« Prev 1 Next »