Andre MATOS <[EMAIL PROTECTED]> wrote: > > How can I subtract two dates and get the number of days? > > (date1 - date2) = days >
Take a look at TO_DAYS() function: SELECT TO_DAYS(date1) - TO_DAYS(date2) or DATEDIFF() function (supported from 4.1.1) http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]