Access to Excel combining criteria

G

Guest

Using xl2000, Access 2000 with ADO query
The first 2 sql statements work, but I cant seem to get the syntax to
combine them as in #3 below.
Any help?
thanks

sql = "Select " & sFields & _
" From " & sTable & _
" WHERE (((DOB) >= #1/1/90#))"

sql = "Select " & sFields & _
" From " & sTable & _
" WHERE (((Lname)Like""B%""))"

sql = "Select " & sFields & _
" From " & sTable & _
" WHERE (((DOB) >= #1/1/90#), ((Lname)Like""B%""))"
 
R

Rob van Gelder

instead of a comma, try AND
eg.
select * from table where DOB >= 1-Jan-1990 AND lname like 'B%'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top