Log in

View Full Version : Solved: Request SQL Syntax



m.azrie
01-09-2007, 10:24 PM
I have two table;
1. Tab1 contain field (Name, Address)
2. Tab2 contain field (Tel No, Fax)

what SQL Syntax to list;
Name, Address, Tel No, Fax

However, there is no key fields for both table......

Bob Phillips
01-10-2007, 03:55 AM
Scratch my response - I was in the wrong group.

OBP
01-10-2007, 05:28 AM
To bring the 2 tables together in a query you must have a Relationship between them, there must be a "common" field, which is usually the ID number of the first table held in the second table to tell access which records in table 2 belong to which records in table 1.

XLGibbs
01-10-2007, 08:17 AM
I agree with OBP, you can't join tables with no common relationships...how would the SQL, formula or otherwise know which number goes where?

Imdabaum
01-10-2007, 03:59 PM
It might be easier to make those tables into one table. Of course I don't know the end goal you are looking for, but from my experience a table storing a name and an address would also be a good place for the fax no, phone, and other contact info for the name. Just a thought.

m.azrie
01-10-2007, 05:38 PM
That's only a sample as easier to understand what i want to... Actually i have a data in 2 file.txt which link table in my excess file. Then i want to create a query which can listed both file in same query. unfortunately, there's no key to link it, however, total item in both file is exacly same.

Currently, I use to append it in new table and put outonumber fileds on each table, and link both file using this number. but what i concern is that auto number become larger soon..


Thanks for respone anyway.....