Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LIKE Statement with multiple criteria

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
US
I am trying to pull a report based on a wildcard and passing critering to the report. For example I want to be able to pull a report that runs a query with a field called IDTYPE. For this I want to be able to pass a criteria to the report via VBA. it is calling for the IDTYPE to be LIKE 'GID*' or 'SID*'.

The report works fine if I just enter either 'GID*' or 'SID*'. My question is can LIKE be used with multiple parameters, such as LIKE 'GID*' or 'SID*'?

When I do that it pulls up all the records not specific to GID or SID.

I am using a couple of dropdown boxes to select month and the field (IDTYPE) and Responsible group. I use a text box to type the 'SID*' etc..

The Criteria Statment it generates to pass to the report is:

InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like 'SID*' (this one works fine)

will not work:

InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like 'SID*' or 'GID*'
 
How about:
InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like 'SID*' or Like 'GID*'
 
Have you tried this ?
'[SG]ID*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
No that does not work. I have tried the following with better results:

InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like 'SID*' or ID TYPE Like 'GID*'

But it is pulling now multipe groups from the resp_group not what has been designated.
 
Either this:
InitialReveiwphase='May' and Resp_Group='ASR' and [!]([/!]IDType Like 'SID*' or ID TYPE Like 'GID*'[!])[/!]

Or this:
InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like '[GS]ID*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks for the information, I used:

InitialReveiwphase='May' and Resp_Group='ASR' and IDType Like '[GS]ID*'

works like a charm!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top