Results 1 to 6 of 6

Thread: Sql problem!

  1. #1
    Join Date
    Feb 2004
    Posts
    41

    Unanswered: Sql problem!

    Im trying to get hte user to enter a specific outlet and return a result that will allow them to see what vehicles are available to rent! I have it working but the way it is im asking them to enter in the outlet twice -

    SELECT Vehicle_Detail.vehicle_no, Vehicle_Detail.outlet_no
    FROM Vehicle_Detail
    WHERE (((Vehicle_Detail.vehicle_no) Not In (SELECT Vehicle_Detail.vehicle_no
    FROM Vehicle_Detail INNER JOIN Rental_Agreement ON Vehicle_Detail.vehicle_no=Rental_Agreement.vehicle _no
    WHERE (((Vehicle_Detail.outlet_no)=[Outlet?eg Ballingarry,Ballincollig,Mahon,Cork]) And ((Date()) Between (Rental_Agreement.date_start) And (Rental_Agreement.date_return))))) AND (Vehicle_Detail.outlet_no) =[Outlet?eg Ballingarry,Ballincollig, Mahon, Cork]);

    Can anyone help?

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    simple problem
    look
    you have two diferent parameters
    Outlet?eg Ballingarry,Ballincollig,Mahon,Cork
    Outlet?eg Ballingarry,Ballincollig, Mahon, Cork

    make them same.

    and by the way add to your SQL
    PARAMETERS [Outlet?eg Ballingarry,Ballincollig,Mahon,Cork] Text ( 255 );
    at the begining
    Last edited by Kakha; 02-16-04 at 13:56.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Feb 2004
    Posts
    41
    How can i make them the same tho? When i take away the second one it show all the vehicles from the other outlets as well!!

  4. #4
    Join Date
    Feb 2004
    Posts
    41
    When you say at the start do you mean before the SELECT?

  5. #5
    Join Date
    Feb 2004
    Posts
    199
    jill83, can you be more carefull?
    can you see that
    Outlet?eg Ballingarry,Ballincollig,Mahon,Cork
    and
    Outlet?eg Ballingarry,Ballincollig, Mahon, Cork
    aren't same?
    second one have one more space between "Ballincollig" and "Cork"
    that means that there is two parameters and you'll be asked twise.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  6. #6
    Join Date
    Feb 2004
    Posts
    41
    sorry ive been staring at this too long, im didnt even pick up on that!!
    Thanxs,

Posting Permissions

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