2 seperate parameters for one query

janed

Registered User.
Local time
Today, 08:00
Joined
Feb 6, 2002
Messages
60
i have a database set up for a telephone system. one of the fields in it is "extension number". the other fields include things like name, room number etc. it is sometimes the case that i will want to bring up two records, by typing in their extension numbers, and "swap" them. i was wondering if it is possible to set a query to ask for one extendion number and then to ask for a second extension number and then to show me both the records. please help if you can! thanks a million.
 
SELECT TblName.Field1, TblName.Field2
FROM TblName
WHERE (TblName.Field1=1) OR (TblName.Field1=2);

That's the basic SQL code. You can change the 1 and 2 to whatever you are wanting to show and you can create this in code and use variable ie you could have a custom InputBox asking for the 2 numbers and then returning the data.
 
The easiest way to get your input boxes is to open your query in design view. In the "Criteria" field under extension number type "[Enter first extension:]" without the quotes, In the "or" field under extension number type "[Enter second extension:]" without the quotes.
This will prompt you for the first and second extension and return results with either of the two.
 

Users who are viewing this thread

Back
Top Bottom