Gustave 0 Report post Posted February 7, 2012 Scotty,The wonderful code you provided three years ago stopped working yesterday morning.When I run the report now, I suddenly getError: The syntax of the query run with this report (ID: 42) was incorrect, and as a result the report could not be run. Please contact the system administrator at suggest@sprague-database.org.Query: SELECT id, pl.gedcom, concat('', pl.place, '') as Places, notes, concat('', evcount, '') as eventcount FROM tng_places as pl join ( select gedcom, place, count(*) as evcount from ( SELECT gedcom, birthplace AS place FROM `tng_people` WHERE gedcom = 'spragueproject' UNION all SELECT gedcom, altbirthplace FROM `tng_people` WHERE gedcom = 'spragueproject' UNION all SELECT gedcom, marrplace FROM `tng_families` WHERE gedcom = 'spragueproject' UNION all SELECT gedcom, deathplace FROM `tng_people` WHERE gedcom = 'spragueproject' UNION all SELECT gedcom, burialplace FROM `tng_people` WHERE gedcom = 'spragueproject' UNION all SELECT gedcom, eventplace FROM tng_events WHERE gedcom = 'spragueproject' ) as p group by gedcom, place ) as plc using ( gedcom, place ) where (isnull(longitude) or isnull(latitude) or longitude='' or latitude = '') order by evcount desc, gedcom, pl.placeError Message:Here is what I am using in TNG Reports:OR Leave Display, Criteria and Sort fields blank and enter direct SQL SELECT statement here:SELECT id, pl.gedcom,concat('<a href="admin/editplace.php?ID=',pl.id,'&tree=', pl.gedcom,'", target=_blank>', pl.place, '</a>') as Places, notes, concat('<a href="placesearch.php?psearch=',replace(pl.place,' ','+'), '">', evcount, '</a>') as eventcountFROM tng_places as pljoin( select gedcom, place, count(*) as evcount from( SELECT gedcom, birthplace AS placeFROM `tng_people`WHERE gedcom = 'spragueproject'UNION all SELECT gedcom, altbirthplaceFROM `tng_people`WHERE gedcom = 'spragueproject'UNION all SELECT gedcom, marrplaceFROM `tng_families`WHERE gedcom = 'spragueproject'UNION all SELECT gedcom, deathplaceFROM `tng_people`WHERE gedcom = 'spragueproject'UNION all SELECT gedcom, burialplaceFROM `tng_people`WHERE gedcom = 'spragueproject'UNION all SELECT gedcom, eventplaceFROM tng_eventsWHERE gedcom = 'spragueproject') as p group by gedcom, place) as plc using ( gedcom, place )where (isnull(longitude) or isnull(latitude) or longitude='' or latitude = '')order by evcount desc, gedcom, pl.placeTo run the report yourself, please go tohttp://www.sprague-database.org/genealogy/reports.php.scroll down to #36, "xx-Places - No Coordinates" and click on it.Many, many thanks,Arnold Share this post Link to post Share on other sites