{sql:SELECT her_event.watprn as 'PRN', her_event.name as 'Name', her_event.summary as 'Summary', her_event.event_type as 'Event Type', her_event.eventbyo as 'Organisation', her_event.eventbyp as 'Person', her_event.eyear as 'Year', geo_locations.ngr as 'NGR',geo_locations.east as 'X',geo_locations.nrth as 'Y',geo_locations.unitary as 'Unitary Authority',geo_locations.community as 'Community', her_event.compiledon as 'Record created', her_event.lastupdate as 'Last Updated'
FROM her_event
LEFT JOIN geo_locations ON her_event.watprn = geo_locations.watprn
where `her_event`.`watprn` IN(search_selection(`her_event`) and (her_event.restricted = '0' or her_event.restricted IS NULL))}