SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/ 57.2958 ) * SIN( sm.lat / 57.2958 ) + COS( / 57.2958 ) * COS( sm.lat ...' at line 2 with query: SELECT sm.station,sm.city as city, sm.state as state, sm.name as name, sm.station as station, sm.type as type, sm.lat as lat, sm.lon as lon, sm.hasdata as hasdata,sm.start_date as start_date,sm.end_date as end_date, sm.active as active, sm.has_2010_normal as has_normal, 3963 * ACOS(ROUND(SIN( / 57.2958 ) * SIN( sm.lat / 57.2958 ) + COS( / 57.2958 ) * COS( sm.lat /57.2958 ) * COS( ( sm.lon / 57.2958) - ( / 57.2958 ) ) ,15)) AS distance,1+TIMESTAMPDIFF(YEAR,sm.start_date,sm.end_date) as diff FROM sercc.statmeta AS sm WHERE sm.station IN ('',(SELECT ASOS FROM sercc.climper_cities WHERE (COOP='' OR THREADEX='') LIMIT 1)) AND sm.start_date<=DATE_FORMAT('2025-12-16 00:00:00','%Y-%m-%d') AND sm.end_date>=DATE_FORMAT('2025-12-16 23:59:59','%Y-%m-%d') ORDER BY distance ASC, type ASC LIMIT 3

Error Trace: with closest results: SELECT sm.station,sm.city as city, sm.state as state, sm.name as name, sm.station as station, sm.type as type, sm.lat as lat, sm.lon as lon, sm.hasdata as hasdata,sm.start_date as start_date,sm.end_date as end_date, sm.active as active, sm.has_2010_normal as has_normal, 3963 * ACOS(ROUND(SIN( / 57.2958 ) * SIN( sm.lat / 57.2958 ) + COS( / 57.2958 ) * COS( sm.lat /57.2958 ) * COS( ( sm.lon / 57.2958) - ( / 57.2958 ) ) ,15)) AS distance,1+TIMESTAMPDIFF(YEAR,sm.start_date,sm.end_date) as diff FROM sercc.statmeta AS sm WHERE sm.station IN ('',(SELECT ASOS FROM sercc.climper_cities WHERE (COOP='' OR THREADEX='') LIMIT 1)) AND sm.start_date<=DATE_FORMAT('2025-12-16 00:00:00','%Y-%m-%d') AND sm.end_date>=DATE_FORMAT('2025-12-16 23:59:59','%Y-%m-%d') ORDER BY distance ASC, type ASC LIMIT 3