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

RE: Help With a DATETIME Query

2003-10-07 Thread Christensen, Dave
s one is my .02... :-) -Original Message- From: shaun thornburgh [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 3:51 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Help With a DATETIME Query Thanks for your reply, but its not an option! >From: "Dan Greene&q

RE: Help With a DATETIME Query

2003-10-07 Thread shaun thornburgh
Thanks for your reply, but its not an option! From: "Dan Greene" <[EMAIL PROTECTED]> To: "shaun thornburgh" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: RE: Help With a DATETIME Query Date: Tue, 7 Oct 2003 16:41:04 -0400 I know it's not the a

RE: Help With a DATETIME Query

2003-10-07 Thread Dan Greene
I know it's not the answer you're looking for... :( but dealing with overnights has caused me so much aggravation in past apps I've written, I've tended to make the client create two (or more) 'bookings' for the covered time... don't know if it's an option for you, but it's my $0.02. > -

RE: Help With a DATETIME Query

2003-10-07 Thread Andrew Braithwaite
Hi, I would do this in the application layer something like this: $list_of_days_you_want_to_look_at = ('mon','tue','wed'..); Foreach ($day in $list_of_days_you_want_to_look_at) { use a similar query to below but geared to only look at $day instead; } You should get an output like this:

RE: Help With a DATETIME Query

2003-10-07 Thread Andrew Braithwaite
Hi, I would do this in the application layer something like this: $list_of_days_you_want_to_look_at = ('mon','tue','wed'..); Foreach ($day in $list_of_days_you_want_to_look_at) { use a similar query to below but geared to only look at $day instead; } You should get an output like this: