Skip navigation links

MySQL Forums :: Newbie :: Date subtraction (difference) returns bizarre results on month boundary


Advanced Search

Re: Date subtraction (difference) returns bizarre results on month boundary
Posted by: Ryan Albert Rucas ()
Date: September 05, 2011 11:30AM

your current date = 20110905
the date you used = 20110829
----------------------------
76
your current date = 20110905
the date you used = 20110830
----------------------------
75
your current date = 20110905
the date you used = 20110902
----------------------------
3

looks likes just a plain difference.

you might as well try it like this

DATEDIFF( current_date, CAST( '2011-08-29 15:33:30' AS DATE ) )

Options: ReplyQuote


Subject Written By Posted
Date subtraction (difference) returns bizarre results on month boundary Dmitry Katsubo 09/05/2011 06:20AM
Re: Date subtraction (difference) returns bizarre results on month boundary Ryan Albert Rucas 09/05/2011 11:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.