Spreadsheet within Access

  • Thread starter Thread starter Fendley
  • Start date Start date
F

Fendley

I am trying to spreadsheet-like functions within Access.
Can you combine 2 queries to operate on the same report?
Or, does the question make sense? Please help

Rich
 
There are many ways to combine two tables/queries as the source for a
report.

1. Inner join
For correctly normalized data, this is the most common way to join two
tables. For example if you combine Customers and Orders, each row indicates
the details of an order, and the details of the customer who made that
order.

2. Outer join
This is similar to the inner join, but you can include customers how have no
orders, or orders that are not assigned to a customer. The two alternatives
are referred to as Left and Right joins

3. Cartesian product
Two tables in the one query with no join between them generates a record for
every possible combination. So, if you had 100 customers and 1000 products,
the query with both tables and no join would yield 100,000 records.

4. UNION query
Use a UNION where you have two tables that both have similar fields, and you
want a result that simulates them both being in the one table as one longer
list. In this case, a table of 100 customers unioned with another table that
had 200 potential customers would yield 300 records.

Access cannot display the UNION query graphically, but it's easy to do.
Create the two queries just as you would like them, making sure you have the
same number of fields in the same order. Switch the to SQL View (View menu).
Delete the semicolon from the end of the first query, and enter the word
"UNION" instead (without the quotes). Now paste in the SELECT statement from
the other query after the word UNION.
 
Thanks...I will give it a try.

Rich
-----Original Message-----
There are many ways to combine two tables/queries as the source for a
report.

1. Inner join
For correctly normalized data, this is the most common way to join two
tables. For example if you combine Customers and Orders, each row indicates
the details of an order, and the details of the customer who made that
order.

2. Outer join
This is similar to the inner join, but you can include customers how have no
orders, or orders that are not assigned to a customer. The two alternatives
are referred to as Left and Right joins

3. Cartesian product
Two tables in the one query with no join between them generates a record for
every possible combination. So, if you had 100 customers and 1000 products,
the query with both tables and no join would yield 100,000 records.

4. UNION query
Use a UNION where you have two tables that both have similar fields, and you
want a result that simulates them both being in the one table as one longer
list. In this case, a table of 100 customers unioned with another table that
had 200 potential customers would yield 300 records.

Access cannot display the UNION query graphically, but it's easy to do.
Create the two queries just as you would like them, making sure you have the
same number of fields in the same order. Switch the to SQL View (View menu).
Delete the semicolon from the end of the first query, and enter the word
"UNION" instead (without the quotes). Now paste in the SELECT statement from
the other query after the word UNION.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.





.
 
Back
Top