SELECT BK.CUST as [Customer Code],
c.OrganisationV6 as [Organization],
c.contactv6 as [Contact],
c.phone1countrycode as [Phone1 Country],
CONCAT(c.Phone1AreaCode,' ', c.Phone1Digits) as [Phone1],
c.phone1ext [Phone1 Ext],
CONCAT(c.Phone2AreaCode,' ', c.Phone2Digits) as [Phone2],
CONCAT(c.CellAreaCode,' ', c.CellDigits) as [Phone2],
BK.MAX_DATE [Last Booking Entry]
FROM tblcust C
INNER JOIN (select SUBSTRING(booking_no,1,6) as CUST,MAX(EntryDate) as MAX_DATE from tblbookings group by substring(booking_no,1,6)) BK
ON c.Customer_code = BK.CUST
order by bk.MAX_DATE