Multiple Tables

S

StuJol

Using Access 2003, i have several tables, each table has 3 common fileds,
"ID", "Description" and "ActionDate" amonst other fields.

im trying to build a qry that grabs only these 3 common fields from all tables

Can anyone help please??
 
J

Jeff Boyce

I may be missing something.

If the fields are "common", why do you need to see them from all the tables?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

StuJol

i'll explain in another way

tblTasks
ID Description Date Another1
Another2
1 pump pond 21/02/09 12
ededwe
2 turn lights off 22/11/09 32
efdewd

tblAlarms
ID Description Date Another3
Another4
1 T2601 23/11/09 yggyuyg
uyggug

i want a qry to pull, Description and date fields from all tables. hope this
helps.
 
J

John Spencer

You can use a UNION query to do this. UNION queries can only be built in SQL
view.

SELECT [Description], [ActionDate]
FROM tblTasks
UNION ALL
SELECT [Description], [ActionDate]
FROM tblAlarms
UNION ALL
SELECT [Description], [ActionDate]
FROM tblStuJul

If you want unique values then change UNION ALL to UNION

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
S

StuJol

many thanks. worked brilliant. never used union qry's before.

John Spencer said:
You can use a UNION query to do this. UNION queries can only be built in SQL
view.

SELECT [Description], [ActionDate]
FROM tblTasks
UNION ALL
SELECT [Description], [ActionDate]
FROM tblAlarms
UNION ALL
SELECT [Description], [ActionDate]
FROM tblStuJul

If you want unique values then change UNION ALL to UNION

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
i'll explain in another way

tblTasks
ID Description Date Another1
Another2
1 pump pond 21/02/09 12
ededwe
2 turn lights off 22/11/09 32
efdewd

tblAlarms
ID Description Date Another3
Another4
1 T2601 23/11/09 yggyuyg
uyggug

i want a qry to pull, Description and date fields from all tables. hope this
helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top