Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A SIMPLE QUERY???

Status
Not open for further replies.

astrevens

Technical User
Aug 8, 2001
36
GB
ok here is what ive got.
tblRep2:
name Postcode
andy ec1m 4gg
tblNorth:

Postcode
ec1m4

in tblnorth there are the beginning of some postcodes.
In tblRep2 there is a list of companies with their names and full postcodes.

What i want to do is select all of the companies in tblRep2 that have the same start in tblNorth, then append them to a table.
Im stuck and this is pretty urgent, many thanks to the gods of access @ tek-tips!!

 
INSERT INTO tblTemp ( Name, PostCode )
SELECT a.Name, a.PostCode
FROM tblRep2 AS a INNER JOIN tblNorth AS b ON
InStr(a.PostCode,b.PostCode);
I started out with nothing, and I still have most of it.
 
any chance i could have that in an access query?
 
You can type it in exactly that way in SQL View on your query designer, you just can't look at it in the regular design view. Open a new query (you don't need to add the tables) Click View|SQL View and then type it in. Don't forget the semicolon at the end. I started out with nothing, and I still have most of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top