RE: Help with a DATETIME Query Please Using 3.23.54

2004-11-04 Thread Mike Johnson
From: shaun thornburgh [mailto:[EMAIL PROTECTED] > Hi, > > The following query works out the amount of hours a user has > been booked for on a particular day: > > SELECT > (SUM(((DATE_FORMAT(B.Booking_End_Date, "%k") * 60 ) + > DATE_FORMAT(B.Booking_End_Date, "%i")) - > ((DATE_FORMAT(B.Booking

Re: Help with a DATETIME Query PLEASE!

2003-10-10 Thread Rory McKinley
Shaun Not a 100 % sure if this is what you're looking for or if somebody's already suggested it also do not know how practical it is for your application If a booking spans more than one day (e.g. two) split it into two days - and write two records to the table one for each daythis fi

RE: Help With a DATETIME Query PLEASE!

2003-10-08 Thread Dathan Vance Pattishall
I'm under the impression that your over thinking the problem. LOOK-UP the functions DATE_SUB / INTERVAL / TIME_TO_SEC / TO_DAYS and the arithmetic should be easy. - Dathan Vance Pattishall   - Sr. Programmer and mySQL DBA for FriendFinder Inc.   - http://friendfinder.com/go/p40688 -->-Or

Re: Help With a DATETIME Query PLEASE!

2003-10-08 Thread Ben Edwards
On Wed, 2003-10-08 at 09:52, shaun thornburgh wrote: > Hi, > > I have a table called Bookings which has two important columns; > Booking_Start_Date and Booking_End_Date. These columns are both of type > DATETIME. The following query calculates how many hours are available > between the hours of 09