How to simplify SQL?

B

bw

Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?

Thanks for your help.
Bernie
 
M

Marshall Barton

bw said:
Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?


Use criteria like:
A1: . . . B1: . . .
IN(1,2) IN(1,3)
 
B

bw

Marshall Barton said:
bw said:
Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for
B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?


Use criteria like:
A1: . . . B1: . . .
IN(1,2) IN(1,3)

Thanks for the reply Marsh.

While your syntax "compiles" ok, and therefore recognizes the IN
function, I can't find any reference to it on the Internet, or in Access
Help.
Please point me somewhere that explains what "IN" is, and how to use it.

Thanks,
Bernie
 
M

Marshall Barton

bw said:
bw said:
Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for
B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?


Use criteria like:
A1: . . . B1: . . .
IN(1,2) IN(1,3)

While your syntax "compiles" ok, and therefore recognizes the IN
function, I can't find any reference to it on the Internet, or in Access
Help.
Please point me somewhere that explains what "IN" is, and how to use it.

In A2003, it's in Help
Table of Contents
Microsoft Jet SQL Reference
SQL Reserved Words

Be careful, SQL uses IN in two totally different ways. The
IN expression operator we are discussing here, and the IN
predicate that can be used in the FROM clause to specify a
table in an external database.
 
B

bw

Marshall Barton said:
bw said:
bw wrote:

Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the
combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for
B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?


Use criteria like:
A1: . . . B1: . . .
IN(1,2) IN(1,3)

While your syntax "compiles" ok, and therefore recognizes the IN
function, I can't find any reference to it on the Internet, or in
Access
Help.
Please point me somewhere that explains what "IN" is, and how to use
it.

In A2003, it's in Help
Table of Contents
Microsoft Jet SQL Reference
SQL Reserved Words

Be careful, SQL uses IN in two totally different ways. The
IN expression operator we are discussing here, and the IN
predicate that can be used in the FROM clause to specify a
table in an external database.

I have A2002, and there is no MIcrosoft Jet SQL Reference. No wonder I
couldn't find it...
Bernie
 
M

Marshall Barton

bw said:
"Marshall Barton"wrote
bw said:
bw wrote:

Two columns of my SQL STATEMENT are as follows:
A1: [Forms]![boxSeats]![PrintWhich]
Criteria:
1
2

B1: [Forms]![boxSeats]![POne]
Criteria:
1
2

So this means I would need four rows to indicate all the
combinations,
as follows:
A1 B2
1 1
1 2
2 1
2 2

The problem is that I will have 8 values for A1, and maybe 5 for
B2...or
40 combinations!
My QUESTION....Isn't there an easier way to do this?


Use criteria like:
A1: . . . B1: . . .
IN(1,2) IN(1,3)


While your syntax "compiles" ok, and therefore recognizes the IN
function, I can't find any reference to it on the Internet, or in
Access
Help.
Please point me somewhere that explains what "IN" is, and how to use
it.

In A2003, it's in Help
Table of Contents
Microsoft Jet SQL Reference
SQL Reserved Words

Be careful, SQL uses IN in two totally different ways. The
IN expression operator we are discussing here, and the IN
predicate that can be used in the FROM clause to specify a
table in an external database.

I have A2002, and there is no MIcrosoft Jet SQL Reference. No wonder I
couldn't find it...


Sure it's there.

In A2002, open Help, select the Contents tab and then look
down the list of topics for:

MIcrosoft Jet SQL Reference
MIcrosoft Jet SQL Reference
OverView
SQL Reserved Words
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top