Query to return records

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

Guest

I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';
 
I need to have the query return records that have have "R" in field #1 AND /
OR in field #2.

Klatuu said:
The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';

John C. said:
I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] = 'R' Or
[Field #2] = 'R';

John C. said:
I need to have the query return records that have have "R" in field #1 AND /
OR in field #2.

Klatuu said:
The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';

John C. said:
I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
I keep getting this respone:
You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)

Klatuu said:
SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] = 'R' Or
[Field #2] = 'R';

John C. said:
I need to have the query return records that have have "R" in field #1 AND /
OR in field #2.

Klatuu said:
The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';

:

I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
What does the main query look like?

John C. said:
I keep getting this respone:
You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)

Klatuu said:
SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] = 'R' Or
[Field #2] = 'R';

John C. said:
I need to have the query return records that have have "R" in field #1 AND /
OR in field #2.

:

The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';

:

I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
it's a basic select query. Some criteria that include date ranges and a
field that retrieves all 'upgrades'. That's all.

Klatuu said:
What does the main query look like?

John C. said:
I keep getting this respone:
You have written a subquery that can return more than one field without
using the EXISTS reserved word in the main query's FROM clause. Revise the
SELECT statement of the subquery to request only one field. (Error 3306)

Klatuu said:
SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] = 'R' Or
[Field #2] = 'R';

:

I need to have the query return records that have have "R" in field #1 AND /
OR in field #2.

:

The only possibility left is if neither field is R

SELECT [Field #1], [Field #2] FROM MyTable WHERE [Field #1] <> 'R' And
[Field #2] <> 'R';

:

I have a table that has 2 fields that are either "p" or "r". I'm trying to
create a query that will retieve records that are true to the following
condition:

field #1 is R and field #2 is R
field #1 is R and field #2 is not
field #1 is Not and field #2 is R

Can anyone help?
 
Back
Top