If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Number of Passengers Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-11, 09:29
JAYAONLINE JAYAONLINE is offline
Registered User
 
Join Date: Sep 2011
Posts: 3
Red face Number of Passengers Query

I need help to create a query in Microsoft Access 2010 which allows me to change the vehicle depending on the number of passengers.

If the number of passengers is greater than 5 they need a mercedes Viano

AND

If the number of passengers is greater than 6 they need a Chrysler voyager.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 12-08-11, 09:41
mariostg mariostg is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
There is probably a dozen ways of foing this...
Do you have a table that contains pairing values of vehicule, maximum passenger?
Reply With Quote
  #3 (permalink)  
Old 12-08-11, 10:03
JAYAONLINE JAYAONLINE is offline
Registered User
 
Join Date: Sep 2011
Posts: 3
Yes I have attatched a print screen of my vehicle table
Attached Images
File Type: bmp vehicles.bmp (663.8 KB, 5 views)
Reply With Quote
  #4 (permalink)  
Old 12-08-11, 11:14
mariostg mariostg is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
Quote:
SELECT VehicleID, Make, Model, [No of Seats]
FROM [Vehicle Table]
WHERE [no of Seats]>=YourValue
You should avoid using spaces in your field names. It will bite you soon or later.
Reply With Quote
  #5 (permalink)  
Old 12-08-11, 12:36
Ymeoru Ymeoru is offline
Registered User
 
Join Date: Oct 2011
Posts: 2
Red face Greater than 5 & Greater than 6

Quote:
Originally Posted by JAYAONLINE View Post
I need help to create a query in Microsoft Access 2010 which allows me to change the vehicle depending on the number of passengers.

If the number of passengers is greater than 5 they need a mercedes Viano

AND

If the number of passengers is greater than 6 they need a Chrysler voyager.

Thank you.
So, the only time they need a Mercedes Viano is if there are six passengers?
Reply With Quote
  #6 (permalink)  
Old 12-08-11, 14:49
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
that doesn't sound credible
surely your query shoudl return any vehicle which has the same or more number of seats
even for homework I can't see a situation where an (even a theoretical) organistaion is going to say.. sorry we cant hire a vehicle out to you because we have no 5 seat vehicles, despite their being 6 or 7 seater vehicles available
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Tags
microsoft access 2010, query, query builder

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On