Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2011
    Posts
    3

    Red face Unanswered: 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.

  2. #2
    Join Date
    Apr 2011
    Posts
    34
    There is probably a dozen ways of foing this...
    Do you have a table that contains pairing values of vehicule, maximum passenger?

  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Yes I have attatched a print screen of my vehicle table
    Attached Thumbnails Attached Thumbnails vehicles.bmp  

  4. #4
    Join Date
    Apr 2011
    Posts
    34
    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.

  5. #5
    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?

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •