Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 10th, 2007, 03:13 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi avdhut_s,

Yes. I think there was a problem with original query. However, I had been using the same type of logic as suggested by Peso. And, I was able to figure out where the problem was. There's basically four cases that you have to check for:

1. Where the Start Time for a request is less than a reservation time and the End Time is greater than the reservation start time:
WHERE RequestStart < DB_Res_Start AND RequestEnd > DB_Res_Start
2. Where the Start Time for a request is les than a reservation end time and the End Time for the request is greater than the reservation end time.
AND RequestStart < DB_Res_End AND RequestEnd > DB_Res_End
3. Where the Start Time and the End Time for a request are both within a reservation time.
4. Where the Start Time for a request is less than and reservation and the End Time for the request is greater than the reservation end time.
End Time for the request is greater than a reservation start time and the

I think everyone here is trying to help you think this thing out for yourself. I've given you almost the whole query. If you can't figure it out, post your best query here. You're almost there. If it was any more complicated I would just go ahead and post the whole query. But its really not that difficult. You must be very close by now.


 
Old December 10th, 2007, 03:19 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Actually Peso gave you what was missing from my first query.






Similar Threads
Thread Thread Starter Forum Replies Last Post
A Simple Problem paole Wrox Book Feedback 7 July 23rd, 2007 08:55 PM
Aligning two chart plot areas - simple but tricky! Alseikhan Excel VBA 0 March 20th, 2006 07:18 PM
Simple problem rsa3des Classic ASP Basics 4 August 8th, 2005 06:14 PM
Tricky asp/sql problem cedwards Dreamweaver (all versions) 8 June 13th, 2005 04:02 PM
Tricky Javascript/XSL '&' problem...... robster Javascript How-To 1 January 23rd, 2004 02:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.