search for multiple criteria

SteveBB

New Member
Joined
Dec 28, 2011
Messages
11
Hi,

I'm having a little trouble creating a query that will allow me to search my table using multiple user defined criteria from a single field.

The database holds a list of email addresses and a respective email template that should be sent. Some of the templates are the same and so I need to be able to search for multiple user defined template ID's.

I've tried using the following:-

SELECT Templates.[Template ID], Templates.partner, Templates.[Customer Type], Templates.[Account Type], Templates.account_number, Templates.Title, Templates.[First name], Templates.[Last name], Templates.email_address
FROM Templates
WHERE (((Templates.[Template ID ])=[insert template ID])) OR (((Templates.[Template ID])=[insert template ID]));

This was created in access query design and I used the OR field to create this one. I also tried using the "OR" function within the main criteria line but in both scenarios I'm only asked once for a template ID .

I even tried adding the template ID field twice but got the same result.

I need to be able to enter multiple ID's in the query.

Any help greatly appreciated :)
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Never Mind - I figured it out - I needed to define the 2 separate criteria by having different names so instead of using [Insert template ID] twice I added and 1 & 2 problem solved :)

Hi,

I'm having a little trouble creating a query that will allow me to search my table using multiple user defined criteria from a single field.

The database holds a list of email addresses and a respective email template that should be sent. Some of the templates are the same and so I need to be able to search for multiple user defined template ID's.

I've tried using the following:-

SELECT Templates.[Template ID], Templates.partner, Templates.[Customer Type], Templates.[Account Type], Templates.account_number, Templates.Title, Templates.[First name], Templates.[Last name], Templates.email_address
FROM Templates
WHERE (((Templates.[Template ID ])=[insert template ID])) OR (((Templates.[Template ID])=[insert template ID]));

This was created in access query design and I used the OR field to create this one. I also tried using the "OR" function within the main criteria line but in both scenarios I'm only asked once for a template ID .

I even tried adding the template ID field twice but got the same result.

I need to be able to enter multiple ID's in the query.

Any help greatly appreciated :)
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top