C
cjg.groups
Hello, is there an easy way to force many types of queries to show all
records in a set, even if their fields have no data? I am using
multiple queries to populate a single Word table, so the data in each
row must be for the same entity, even if there are blanks.
For example, query1 does AVG to produce:
id avgs
1 3300
2 4400
4 9900
query2 is a cross-tab doing SUM to produce:
id sums
2 56
4 60
7 71
I use VB to populate a single Word table in two steps, one query at a
time, to get:
id avgs sums
1 3300
2 4400 56
4 9900 60
7 71
This would be much easier if query1 and query2 would show a record for
each id in the complete set. Currently, I LEFT JOIN the actual
queries to a query of all id's. This isn't working when my cross-tab
returns an empty set. It would be fine if the cross-tab returned a
set of all id's, even with NULL in the other fields.
I thought you could do:
WHERE <conditionals> IN [SELECT id FROM table WHERE <conditionals>]
to get a consistent list of id's to display.
Any easier methods would be appreciated. Thanks!
records in a set, even if their fields have no data? I am using
multiple queries to populate a single Word table, so the data in each
row must be for the same entity, even if there are blanks.
For example, query1 does AVG to produce:
id avgs
1 3300
2 4400
4 9900
query2 is a cross-tab doing SUM to produce:
id sums
2 56
4 60
7 71
I use VB to populate a single Word table in two steps, one query at a
time, to get:
id avgs sums
1 3300
2 4400 56
4 9900 60
7 71
This would be much easier if query1 and query2 would show a record for
each id in the complete set. Currently, I LEFT JOIN the actual
queries to a query of all id's. This isn't working when my cross-tab
returns an empty set. It would be fine if the cross-tab returned a
set of all id's, even with NULL in the other fields.
I thought you could do:
WHERE <conditionals> IN [SELECT id FROM table WHERE <conditionals>]
to get a consistent list of id's to display.
Any easier methods would be appreciated. Thanks!