SELECT * FROM tblTest WHERE ([CheckVoucherNumber] = [Check Voucher
Number?]
OR [Check Voucher Number?] IS NULL) AND ([CheckNumber] = [Check Number?]
OR
[Check Number?] IS NULL) AND ([PayeeName] = [Payee Name?] OR [Payee
Name?]
IS NULL)
In this example, CheckVoucherNumber, CheckNumber and PayeeName are field
names, and [Check Voucher Number?], [Check Number?] and [Payee Name?] are
parameters.
--
Brendan Reynolds (MVP)
Mr. Capuchino said:
Actually i have a table which have field names of check voucher
numbers,
check numbers, payee and so on.. i think it would be easier if i have
one
select query that i can input any of the two numbers or a payee name
and
it
would return the results...
:
SELECT * FROM TableName WHERE Field1 = Whatever OR Field2 = Whatever
OR
Field3 = Whatever ...
Note that it very rarely, if ever, makes sense to search *all*
fields -
if
you're searching for a product name, for example, you're not going to
find
it in the customer name field, and you're certainly not going to find
it
in
the order date field ...
--
Brendan Reynolds (MVP)
message
Help please... how do you search for data using the select query?
The
things
is i have a table and by using the select query i want to type any
field i
want to search for...
i've already used the select query but i was only able to specify
one
field
i wanted to search for...