Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Access to Excel combining criteria
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%""))" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Access to Excel combining criteria
instead of a comma, try AND
eg. select * from table where DOB = 1-Jan-1990 AND lname like 'B%' -- Rob van Gelder - http://www.vangelder.co.nz/excel "gocush" /delete wrote in message ... 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%""))" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Access to Excel combining criteria
Thanks That works
"Rob van Gelder" wrote: instead of a comma, try AND eg. select * from table where DOB = 1-Jan-1990 AND lname like 'B%' -- Rob van Gelder - http://www.vangelder.co.nz/excel "gocush" /delete wrote in message ... 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%""))" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combining COUNTIF Criteria | Excel Discussion (Misc queries) | |||
Applying Criteria in Excel Cell to MS Query Pull from Access | Excel Discussion (Misc queries) | |||
export access to excel. change access & update excel at same time | Excel Discussion (Misc queries) | |||
Getting Access Error Messages when running Access through Excel | Excel Programming | |||
Using InputBox to change query criteria in Access | Excel Programming |