« 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);

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.