Query from two tables (1 Viewer)

popen

Registered User.
Local time
Today, 07:39
Joined
Oct 16, 2000
Messages
37
I will try to keep this as brief as possible.
This involves two tables, say, table 1 and table 2. Both tables are identical in design and fields, but when a date is entered in a specific field in table 1, append and delete queries are run to copy the record over to table 2 and delete it from table 1.
I guess you could call table 1 'live data', and table two 'archive'.
OK, now this is the tricky part;
What I need to achieve is to design a query that calculates a simple 'DateDiff' calculation against two fields. No problem there. The problem lies where I need this calculation run against the fields on BOTH tables, to look at historic data aswell as current to get a total from, say, the past six months to present.
I can get the query to provide the information off one table, but is it possible to get both the tables together on one query ?

Any help out there?

-NEIL
 

KDg

Registered User.
Local time
Today, 07:39
Joined
Oct 28, 1999
Messages
181
if the tables have identical fields you should be able to do a UNION query to get them together. Depending on how complicated the single queries are you may need/want to do 2 seperate queries and then pull it together into one

HTH

Drew
 

popen

Registered User.
Local time
Today, 07:39
Joined
Oct 16, 2000
Messages
37
Excellent ! Many thanks. I used 'UNION ALL' statement and I achieved the results I was after.

Regards,

-NEIL
 

Users who are viewing this thread

Top Bottom