I made two queries.. Query A works, but Query B dosn't.
A, is supposed to pull somebodies information when doing a search by
department name. It can also pull stuff up by an alternate department name.
the keys obviously are deptno.
Query A: WORKING ------
SELECT book.recid,book.l_name,book.f_name,
book.mid_init,book.phone,deptnames.deptname
FROM book,deptnames
WHERE book.deptno = deptnames.deptno
AND (deptnames.deptname LIKE "%user_input%"
OR deptnames.altname LIKE "%user_input%")
ORDER BY book.l_name
Query B: When I put this into access it gives me a popup asking for a
value for book.deptno... If i put in a number it returns everybody in
the table, and the deptartment name who has that deptno..
This query should essentially be the same as query A, but also allow you
to search by just about anything within the same query.
SELECT book.recid,book.l_name,book.f_name,
book.mid_init,book.phone,deptnames.deptname
FROM book,deptnames
WHERE book.l_name LIKE "%house%"
OR book.f_name LIKE "%house%"
OR book.phone LIKE "%house%"
OR ((book,deptno = deptnames.deptno) AND (deptnames.deptname LIKE
"%house%") OR (deptnames.altname LIKE "%house%"))
ORDER BY book.l_name
(hope i didn't make any type-o's there... copy and past wasn't an option.)
THANKS MUCH.