How do I query different values within the same field in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to be able to pull out two different lot numbers and compare/contrast
the data. How do I write the criteria?
 
A where clause like the following should work:
WHERE LotNumber = 34 or LotNumber = 142

You might need to be more specific in order to get a more specific answer.
 
I see my question was incomplete. Currently I have [Enter Lot Number] in my
criteria so that when I open my query it prompts me for a lot number and then
displays only that record. How can I structure my criteria so that it prompts
me for two lot numbers and displays both records?
 
I don't use parameter queries since they are not very functional. However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
I see my question was incomplete. Currently I have [Enter Lot Number] in my
criteria so that when I open my query it prompts me for a lot number and
then
displays only that record. How can I structure my criteria so that it
prompts
me for two lot numbers and displays both records?

lramey said:
I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
Well when I do what you suggested only one record comes up. Bummer. It seems
a pity that you can't extract just two records from my datatbase. There ought
to be some way to phrase the criteria.

Thanks, Lisa

Duane Hookom said:
I don't use parameter queries since they are not very functional. However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
I see my question was incomplete. Currently I have [Enter Lot Number] in my
criteria so that when I open my query it prompts me for a lot number and
then
displays only that record. How can I structure my criteria so that it
prompts
me for two lot numbers and displays both records?

lramey said:
I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
What is the full SQL view of your query. My suggestion should allow you to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

lramey said:
Well when I do what you suggested only one record comes up. Bummer. It
seems
a pity that you can't extract just two records from my datatbase. There
ought
to be some way to phrase the criteria.

Thanks, Lisa

Duane Hookom said:
I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
I see my question was incomplete. Currently I have [Enter Lot Number] in
my
criteria so that when I open my query it prompts me for a lot number
and
then
displays only that record. How can I structure my criteria so that it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
Tell me where to find the full SQL view of my query and I'll get you the
answer.

Duane Hookom said:
What is the full SQL view of your query. My suggestion should allow you to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

lramey said:
Well when I do what you suggested only one record comes up. Bummer. It
seems
a pity that you can't extract just two records from my datatbase. There
ought
to be some way to phrase the criteria.

Thanks, Lisa

Duane Hookom said:
I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot Number] in
my
criteria so that when I open my query it prompts me for a lot number
and
then
displays only that record. How can I structure my criteria so that it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

lramey said:
Tell me where to find the full SQL view of my query and I'll get you the
answer.

Duane Hookom said:
What is the full SQL view of your query. My suggestion should allow you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

lramey said:
Well when I do what you suggested only one record comes up. Bummer. It
seems
a pity that you can't extract just two records from my datatbase. There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot Number]
in
my
criteria so that when I open my query it prompts me for a lot number
and
then
displays only that record. How can I structure my criteria so that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
SELECT [985118].Product, [985118].[Date of Manufacture], [985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC, [985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold, [985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

Duane Hookom said:
While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

lramey said:
Tell me where to find the full SQL view of my query and I'll get you the
answer.

Duane Hookom said:
What is the full SQL view of your query. My suggestion should allow you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up. Bummer. It
seems
a pity that you can't extract just two records from my datatbase. There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot Number]
in
my
criteria so that when I open my query it prompts me for a lot number
and
then
displays only that record. How can I structure my criteria so that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
My suggestion was to replace:
[Enter Lot Number]
with:
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
SELECT [985118].Product, [985118].[Date of Manufacture], [985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC, [985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold, [985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

Duane Hookom said:
While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

lramey said:
Tell me where to find the full SQL view of my query and I'll get you
the
answer.

:

What is the full SQL view of your query. My suggestion should allow
you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up. Bummer.
It
seems
a pity that you can't extract just two records from my datatbase.
There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot
Number]
in
my
criteria so that when I open my query it prompts me for a lot
number
and
then
displays only that record. How can I structure my criteria so
that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
When I do that, it asks for Enter Lot Number, Enter First Lot Number and
Enter Secind Lot Number. Only one record comes up in the query, that of the
last lot number that I entered.

Thanks, Lisa

Duane Hookom said:
My suggestion was to replace:
[Enter Lot Number]
with:
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
SELECT [985118].Product, [985118].[Date of Manufacture], [985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC, [985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold, [985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

Duane Hookom said:
While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

Tell me where to find the full SQL view of my query and I'll get you
the
answer.

:

What is the full SQL view of your query. My suggestion should allow
you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up. Bummer.
It
seems
a pity that you can't extract just two records from my datatbase.
There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot
Number]
in
my
criteria so that when I open my query it prompts me for a lot
number
and
then
displays only that record. How can I structure my criteria so
that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
Please paste your full SQL view into a reply.

--
Duane Hookom
MS Access MVP
--

lramey said:
When I do that, it asks for Enter Lot Number, Enter First Lot Number and
Enter Secind Lot Number. Only one record comes up in the query, that of
the
last lot number that I entered.

Thanks, Lisa

Duane Hookom said:
My suggestion was to replace:
[Enter Lot Number]
with:
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

lramey said:
SELECT [985118].Product, [985118].[Date of Manufacture], [985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC, [985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold, [985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

:

While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

Tell me where to find the full SQL view of my query and I'll get you
the
answer.

:

What is the full SQL view of your query. My suggestion should allow
you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up.
Bummer.
It
seems
a pity that you can't extract just two records from my datatbase.
There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very
functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot
Number]
in
my
criteria so that when I open my query it prompts me for a lot
number
and
then
displays only that record. How can I structure my criteria so
that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
OK, our corporate Computer geek came down to the lab and between the three
of us (what I've tried with you and by myself) we worked it out. You have to
put in Between [Enter 1st Lot #] and [Enter 2nd Lot #], which I would have
sworn that I tried already, but it worked with him. Thanks for all your help.

Lisa

Duane Hookom said:
Please paste your full SQL view into a reply.

--
Duane Hookom
MS Access MVP
--

lramey said:
When I do that, it asks for Enter Lot Number, Enter First Lot Number and
Enter Secind Lot Number. Only one record comes up in the query, that of
the
last lot number that I entered.

Thanks, Lisa

Duane Hookom said:
My suggestion was to replace:
[Enter Lot Number]
with:
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

SELECT [985118].Product, [985118].[Date of Manufacture], [985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC, [985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold, [985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

:

While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

Tell me where to find the full SQL view of my query and I'll get you
the
answer.

:

What is the full SQL view of your query. My suggestion should allow
you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up.
Bummer.
It
seems
a pity that you can't extract just two records from my datatbase.
There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very
functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter Lot
Number]
in
my
criteria so that when I open my query it prompts me for a lot
number
and
then
displays only that record. How can I structure my criteria so
that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers and
compare/contrast
the data. How do I write the criteria?
 
Glad to hear this is resolved. "pull out two different lot numbers" is
somewhat different from "Between...."

If we had been aware you were looking at defining a range of lot numbers,
this thread would have resolved much earlier.

--
Duane Hookom
MS Access MVP
--

lramey said:
OK, our corporate Computer geek came down to the lab and between the three
of us (what I've tried with you and by myself) we worked it out. You have
to
put in Between [Enter 1st Lot #] and [Enter 2nd Lot #], which I would have
sworn that I tried already, but it worked with him. Thanks for all your
help.

Lisa

Duane Hookom said:
Please paste your full SQL view into a reply.

--
Duane Hookom
MS Access MVP
--

lramey said:
When I do that, it asks for Enter Lot Number, Enter First Lot Number
and
Enter Secind Lot Number. Only one record comes up in the query, that of
the
last lot number that I entered.

Thanks, Lisa

:

My suggestion was to replace:
[Enter Lot Number]
with:
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

SELECT [985118].Product, [985118].[Date of Manufacture],
[985118].[Lot
numbers], [985118].[Protein, Dry Basis %], [985118].[Protein, as
is],
[985118].[% Moist], [985118].[% Fat], [985118].SPC,
[985118].Coliform,
[985118].[e Coli], [985118].Yeast, [985118].Mold,
[985118].Salmonella,
[985118].Disk
FROM 985118
WHERE ((([985118].[Lot numbers])=[Enter Lot Number]));
Does this give you something to work with?
Lisa

:

While in the query design view, select View->SQL...

--
Duane Hookom
MS Access MVP
--

Tell me where to find the full SQL view of my query and I'll get
you
the
answer.

:

What is the full SQL view of your query. My suggestion should
allow
you
to
enter two lot numbers and they both should "come up".

--
Duane Hookom
MS Access MVP
--

Well when I do what you suggested only one record comes up.
Bummer.
It
seems
a pity that you can't extract just two records from my
datatbase.
There
ought
to be some way to phrase the criteria.

Thanks, Lisa

:

I don't use parameter queries since they are not very
functional.
However,
you can use
[Enter First Lot Number] or [Enter Second Lot Number]

--
Duane Hookom
MS Access MVP
--

I see my question was incomplete. Currently I have [Enter
Lot
Number]
in
my
criteria so that when I open my query it prompts me for a
lot
number
and
then
displays only that record. How can I structure my criteria
so
that
it
prompts
me for two lot numbers and displays both records?

:

I need to be able to pull out two different lot numbers
and
compare/contrast
the data. How do I write the criteria?
 
Back
Top