m17347047711116
Registered User.
- Local time
- Today, 15:12
- Joined
- Feb 4, 2002
- Messages
- 68
I want to query a table
Table has Order data as in the following sample:
[M1], [M2], [Order #], [Order Qty]
I want to query all the records in the table where
[M1] or [M2] is equal to 22
I know how to specify the criteria in the query for one field at a time, but I have never done it like this,
If I set the criteria in each field [M1] & [M2] as =22 then I only get the records where both fields are =22,
What I really want the query to return is all records where [M1] = 22 and
All the records where [M2] =22
below is a sample of some data to demonstrate:
[M1].....[M2]....[Order #]....[Qty]
[01].....[22].....[123456].....[100]
[22].....[86].....[123457 ]....[200]
[01].....[86].....[123458 ]....[300]
[22].....[22].....[123459 ]....[400]
EXAMPLE "A"
I want the query to return all the records in the table where [M1] & [M2] are 22,
The result on the above data I want is
[M1].....[M2]....[Order #]....[Qty]
[01].....[22].....[123456].....[100]
[22].....[86].....[123457 ]....[200]
[22].....[22].....[123459 ]....[400]
EXAMPLE "B"
The result I am getting when I set the criteria for [M1] =22 and [M2]=22
Is not as above, I am getting:
[M1].....[M2]....[Order #]....[Qty]
[22].....[22].....[123459 ]....[400]
Any idea how I can get Example A vs's B
Table has Order data as in the following sample:
[M1], [M2], [Order #], [Order Qty]
I want to query all the records in the table where
[M1] or [M2] is equal to 22
I know how to specify the criteria in the query for one field at a time, but I have never done it like this,
If I set the criteria in each field [M1] & [M2] as =22 then I only get the records where both fields are =22,
What I really want the query to return is all records where [M1] = 22 and
All the records where [M2] =22
below is a sample of some data to demonstrate:
[M1].....[M2]....[Order #]....[Qty]
[01].....[22].....[123456].....[100]
[22].....[86].....[123457 ]....[200]
[01].....[86].....[123458 ]....[300]
[22].....[22].....[123459 ]....[400]
EXAMPLE "A"
I want the query to return all the records in the table where [M1] & [M2] are 22,
The result on the above data I want is
[M1].....[M2]....[Order #]....[Qty]
[01].....[22].....[123456].....[100]
[22].....[86].....[123457 ]....[200]
[22].....[22].....[123459 ]....[400]
EXAMPLE "B"
The result I am getting when I set the criteria for [M1] =22 and [M2]=22
Is not as above, I am getting:
[M1].....[M2]....[Order #]....[Qty]
[22].....[22].....[123459 ]....[400]
Any idea how I can get Example A vs's B
Last edited: