« How to Lose Customers by saving a little money - Lenovo X300 | Main | Weird Calendar page for September 1752 (the month they dropped 10 days from) »

May 06, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83420e7e053ef00e5522a0a9f8834

Listed below are links to weblogs that reference Date math in MySQL vs. Oracle, PostgreSQL, Oracle, etc., adding floating point numbers, etc.:

Comments

Stephen

And this fails to do what you want, though it seems fine with the syntax. It rounds to the next day.

UPDATE log_table SET end_time = DATE_ADD(start_time, INTERVAL 0.506851 DAY);

But this works:

UPDATE log_table SET end_time = DATE_ADD(start_time, INTERVAL 0.506851 * 3600 * 24 SECOND);

The comments to this entry are closed.