What I mean is can I enter multiple criteria in the same criteria request?
For example I have a query that asks for a plant code. I can enter one
number, say 41, and it will query just fine. If I try to enter two plant
codes, say 41 and 44, it will return nothing. I want the operator to be able
to enter any number of plant codes they need in the same criteria field.
If I wrote it in SQL with hard entered plant codes it would look like this:
SELECT [Scrap Data].[Plant Code], Count([Scrap Data].[Plant Code]) AS
[CountOfPlant Code]
FROM [Scrap Data]
WHERE ((([Scrap Data].[Plant Code])=41)) OR ((([Scrap Data].[Plant Code])=44))
GROUP BY [Scrap Data].[Plant Code]
If I write it in user entry format it looks like this:
SELECT [Scrap Data].[Plant Code], Count([Scrap Data].[Plant Code]) AS
[CountOfPlant Code]
FROM [Scrap Data]
WHERE ((([Scrap Data].[Plant Code])=[Enter Plant number(s)]))
GROUP BY [Scrap Data].[Plant Code];
is there any way to make the criteria [Enter Plant number(s)] be able to
allow multiple plants so that the query will run it like the first mentioned
SQL if I entered plant codes 41 and 44? Meaning enter multiple criteria in
the same criteria request box for the query.
JL said:
Hi James,
Using the "[Criteria]" should let you change the value everytime when you
execute your query.
There is another way that you can query more than one value.
You can build a table that will contain all the values that you want to
retrieve in a single field. Then you can JOIN them and get your records back.
Hope this helps.
:
Is there a way to set up a field so that a query will read the value(s) as
criteria?
I use [plant] but that seems to only allow me to enter one value. Can I get
it to be able to enter two or three? If I can not do it that way is there a
way to get the query to change a value for the criteria?