G
Guest
I am learning Microsoft Access. I have created a very simple table named
"presidents_tbl".
I have constructed a query that uses the "like" statement that will find any
president in the table by typing just part of a president's first name into a
dialog box.
I would like to have Access also look at the last name field for matches
that I type into the dialog box. For example if I type "John" into the
dialog box Access would then return "John Kennedy" and "Lyndon Johnson".
If I can get this to work I will then be on to bigger and better things
using this knowledge, but for now I am stuck.
Here is my SQL code so far...
SELECT presidents_tbl.firstname, presidents_tbl.lastname
FROM presidents_tbl
WHERE (((presidents_tbl.firstname) Like '*' & [] & '*'));
From what I have seen from my Google searches, it looks like I must just put
in a comma somewhere and add "lastname" to the where statement but I can not
get anything to work. (I could not get "OR" to work either)
How do I get Microsoft Access to include both the firstname field and the
last name field in my query?
"presidents_tbl".
I have constructed a query that uses the "like" statement that will find any
president in the table by typing just part of a president's first name into a
dialog box.
I would like to have Access also look at the last name field for matches
that I type into the dialog box. For example if I type "John" into the
dialog box Access would then return "John Kennedy" and "Lyndon Johnson".
If I can get this to work I will then be on to bigger and better things
using this knowledge, but for now I am stuck.
Here is my SQL code so far...
SELECT presidents_tbl.firstname, presidents_tbl.lastname
FROM presidents_tbl
WHERE (((presidents_tbl.firstname) Like '*' & [] & '*'));
From what I have seen from my Google searches, it looks like I must just put
in a comma somewhere and add "lastname" to the where statement but I can not
get anything to work. (I could not get "OR" to work either)
How do I get Microsoft Access to include both the firstname field and the
last name field in my query?