RayH
Registered User.
- Local time
- Today, 04:54
- Joined
- Jun 24, 2003
- Messages
- 132
I have two queries whose results I want to join together in a third.
My problem occurs when one of the queries returns no records so that my third query also returns no records.
I have created some pseudo-queries so that I can demonstrate my problem.
Query One:
select field_a,count(field_a) count_a
from table_a
where field_a=<some_value>
group by field_a
Query Two:
select field_b,count(field_b) count_b
from table_b
where field_b=<some_value>
group by field_b
Query Three:
select field_a,count_a,field_b,count_b
from a,b
<** Note there is no relationship between table_a and table_b ** >
Result:
Query Three will contain no records if EITHER Query One or Query Two
contain no records but works if both do.
example one:
field_a count_a field_b count_b
XXXX 5 YYYY 1
Desired Result:
Query Three to contain one record regardless of the number of records
in either Query One or Query Two.
example two:
field_a count_a field_b count_b
XXXX 5 <null> 0
example three:
field_a count_a field_b count_b
<null> 0 YYYY 1
Is this sort of thing possible in Access?
My problem occurs when one of the queries returns no records so that my third query also returns no records.
I have created some pseudo-queries so that I can demonstrate my problem.
Query One:
select field_a,count(field_a) count_a
from table_a
where field_a=<some_value>
group by field_a
Query Two:
select field_b,count(field_b) count_b
from table_b
where field_b=<some_value>
group by field_b
Query Three:
select field_a,count_a,field_b,count_b
from a,b
<** Note there is no relationship between table_a and table_b ** >
Result:
Query Three will contain no records if EITHER Query One or Query Two
contain no records but works if both do.
example one:
field_a count_a field_b count_b
XXXX 5 YYYY 1
Desired Result:
Query Three to contain one record regardless of the number of records
in either Query One or Query Two.
example two:
field_a count_a field_b count_b
XXXX 5 <null> 0
example three:
field_a count_a field_b count_b
<null> 0 YYYY 1
Is this sort of thing possible in Access?