I just want to return the last entry and have tried using my altered join as follows:
Code: Select all
$the_qry = ("SELECT tl.tl_id, tl.tl_name, tl.tl_contact, tl.tl_town, st.st_counter_end, st.st_split "
. "FROM table_locations AS tl LEFT JOIN service_take AS st ON (tl.tl_id = st.st_tl_id) WHERE MAX(st.st_serviced_date)");Code: Select all
$the_qry = ("SELECT tl.tl_id, tl.tl_name, tl.tl_contact, tl.tl_town, st.st_counter_end, st.st_split "
. "FROM table_locations AS tl LEFT JOIN service_take AS st ON (tl.tl_id = st.st_tl_id) WHERE st.st_serviced_date = MAX(st.st_serviced_date)");Thanks in advance