SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 17th, 2003, 11:42 AM
burnoutuk burnoutuk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Nottingham England
Posts: 7 burnoutuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help needed on a query

I need to make a query that displays pitches at a campsite that are not booked for a given date the user enters.

I have a tbl which holds pitch info tblPitch and a table which holds booking info tblBooking (see attachment)

tblBooking has the pitch number, start date and end date so if theres a date like 1/11/2003 - 7/11/2003

if the user enters a date on or between then i dont want that pitch to be displayed but all pitches that arnt booked to be shown...

im not sure if this makes much sense but if someone gets it please help im new to this.

Heres what ive been trying

SELECT DISTINCT [tblpitch].[siteNo], [tblpitch].[pitchNo]
FROM tblpitch, tblBooking
WHERE tblpitch.pitchNo = tblbooking.pitchNo

And tblBooking.bookingDate between [Enter Date]

and tblbooking.pitchNo NOT IN (select pitchNo from tblBooking)
ORDER BY [tblpitch].[siteNo];


but its wrong as i have no end date or anything.


Thank you for any help.
Attached Images
File Type: jpg tbls.jpg (73.1 KB, 111 views)

Reply With Quote
  #2  
Old October 20th, 2003, 08:26 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Speak it out loudly for yourself:

tblBooking.bookingDate between [Enter Date]

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Help needed on a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway