Mario netMines wrote: > Hi Jasper and thanks for the quick reply. > > something tells me it's not a straightforward SQL query that I have to > use here but a logic using PHP and SQL. Please don't top-post. It can be done in SQL quite easily, as can many things people use PHP for. Go to the MySQL manual at http://dev.mysql.com/ and read up on Date/Time functions, specifically the DATEDIFF() function. IIRC, it returns the difference between two dates. You can perform many types of arithmetic on the return value of the function which should help to get the result you want. Try the MySQL mailing lists if you can't figure it out, or if you're completely stuck and are *convinced* it's a PHP problem (which I doubt, but I could be wrong) then by all means come back! Cheers Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php