I have a similar situation where I need to select zipcode regions that are within 3, 5 and 10 miles of store locations. The way I do it is to first create buffer objects around each store, next select the zipcodes that fall within the buffer objects. I do this by typing the following into the mapbasic window: Dim mobj as Object Create Object as Buffer from store Width 3 units "mi" resolution 20 into variable mobj Select * from nj_zip where obj within mobj This creates a buffer into the variable mobj and selects the zipcodes whose centroids are within the 3 mile buffer zone. I hope this helps Ken Fioretti -------------------------------------------------------------------- Ken Fioretti - [mailto:[EMAIL PROTECTED]] CBA Industries, Inc - (201) 587-1717 -------------------------------------------------------------------- > -----Original Message----- > From: Andrew Bailey [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 15, 1999 7:30 PM > To: mapinfo mailing list > Subject: MI q> SQL to select buildings 1 mile or more from hospital > point set > > > hi there > i have two tables: 'buildings_in_Hackney' which are polylines and > 'hospitals' which are points > i wish to find which buildings are more than a certain distance #away# > from > the hospital points. > I constructed a SQL select which i have summarised below; > select columns * > from Tables: hospitals, buildings_in_Hackney > where condition: > Distance(CentroidX(Hospital.obj),CentroidY(Hospital.obj),CentroidX(Bui > ld > ings > _in_Hackney.obj),CentroidY(Buildings_in_Hackney.obj),"mi")>=1 > group by columns: > order by columns: > into Table Named: Selection > > Verification says ok, but i get an error message upon submission: > 'No join specified between Hospital and Buildings_In_Hackney. Invalid > join > condition in Where clause' > > I've tried swapping round the order of the tables in 'from Tables' > line > but > to no avail. I'm unfamiliar why a join needs to be made between the > two > tables: they both appear on the same map window and obviously > georeferenced > correctly - but even more bobviously i'm missing something rather > important. I think my Distance function is correct - i modified one i > found > at the back of the user manual (v5) > > regards > andy > > > Andrew Bailey > GIS Officer > Estate Management and Development > Strategy and Commissioning > Christopher Addison House > 72 Wilton Way > London E8 1BJ > Tel: 0181 356 2227 > Home email: [EMAIL PROTECTED] > The views expressed are not necessairly the views of LBH. > ---------------------------------------------------------------------- > To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and > put > "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] > ---------------------------------------------------------------------- > To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and > put > "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] > ---------------------------------------------------------------------- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
