Hours available in a day

From: Date: Fri, 03 Oct 2003 11:01:16 +0000
Subject: Hours available in a day
Groups: php.db 
Request: Send a blank email to php-db+get-30818@lists.php.net to get a copy of this message
Hi, I have a table called Bookings which has two important columns; Booking_Start_Time and Booking_End_Time. These columns are both of type DATETIME. Given any day how can I calculate how many hours are available between the hours of 09.00 and 17.30 so a user can see at a glance how many hours they have unbooked on a particular day (i.e. 8.5 hours less the time of any bookings on that day), can this be done with a query or do I have to work it out in my code? Thanks for your help

« previous php.db (#30818) next »