Ok, what I have is 1 DB that contains 2 tables
Table #1 = geocoding
Table #2 = stores
What I basically am trying to do is have a search box on a page that looks up a zipcode (zipid) from the geocoding table. It then finds the 4 closest stores (store1,store2,store3,store4 in the geocoding table)
Then I want to display the info from the stores table that corresponds to the store1,store2,store3,store4 fields from that specific zipid (Store name, address,city,state,zip,phone,fax,email,website,owners name)
Im really lost as to how to write that sql statement?
In the Geocode table I have these fields:
id, ZipdId, Store1, Store2, Store3, Store4 (and a couple more that we dont need to use)
In the stores table I have these fields:
storeNum (this is the number that would appear in the store1-4 fields in the geocode table), storename,address1, address2, city, state, zip, country, phone, fax, email, website, owner
Any help would be greatly appreciated. Im using an access db, with asp btw.