Without testing on my side... how's that? select a.Shop1, a.Shop2, a.Postcode, b.Code, b.Shopname, b.Address1, b.Price from NewsData a, Agents b where (a.Shop1 > '' or a.Shop2 > '') and b.Shopname > '' and (a.Shop1 = b.Shopname or a.Shop2 = b.Shopname) order by a.Postcode asc
On Fri, 8 Oct 2004 18:27:59 +0100, Brian Pugh <[EMAIL PROTECTED]> wrote: > Hi, > > This query, "select distinct Shop1,Shop2,Postcode from NewsData where Shop1>'' or > Shop2>'' order by Postcode asc" > works as I require, but I want to expand the query to include data from another > table, and have got a bit stuck > > The second table is called Agents. If the above query is successful, I want it to > include the columns called > Code, Shopname, Address1 and Price, but only if the Shopname column in the Agents > table matches either > Shop1 or Shop2 in the NewsData table > > Can anyone help me with this? > > Regards, > > Brian Pugh > >