Error in query: ( SELECT DATE_FORMAT(`races`.`date`,"%a %b %e" ) as dateformat, races.year , LOWER(`races`.`staticRaceUrl`) as lstaticraceurl , LEFT( raceName , 40 ) as leftracename, `races`.`month` , `races`.`distance` , `races`.`raceCity` , CASE WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 2 ) = '5K' THEN CONCAT( '  Results5K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 2 ) = '8K' THEN CONCAT( '  Results 8K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 3 ) = '10K' THEN CONCAT( '  Results 10K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 4) = 'Half' THEN CONCAT( '  Results Half ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 8) = 'Marathon' THEN CONCAT( '  Results Marathon ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' THEN CONCAT( '  Results ' , races.distance , '' ) WHEN resultsAvailable = '1' AND LEFT( distance , 2 ) = '5K' THEN CONCAT( '  Results5K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 2 ) = '8K' THEN CONCAT( '  Results 8K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 3 ) = '10K' THEN CONCAT( '  Results 10K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 4) = 'Half' THEN CONCAT( '  Results Half ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 8) = 'Marathon' THEN CONCAT( '  Results Marathon ' ) WHEN resultsAvailable = '1' THEN CONCAT( '  Results ' , races.distance , '' ) WHEN LEFT( distance , 2 ) = '5K' THEN CONCAT( '   5K ' ) WHEN LEFT( distance , 2 ) = '8K' THEN CONCAT( '    8K ' ) WHEN LEFT( distance , 3 ) = '10K' THEN CONCAT( '    10K ' ) WHEN LEFT( distance , 4 ) = 'Half' THEN CONCAT( '    Half ' ) WHEN LEFT( distance , 8 ) = 'Marathon' THEN CONCAT( '    Marathon ' ) ELSE CONCAT( '    ' , races.distance , '' ) END AS distanceColumns , DATE_FORMAT( weekOfDate , "%W %M %d, %Y" ) as formatweek, races.raceCode , tentativeDate, calendarbanner, '1' as goalchecked, races.date as d, 'event' as eventName, myraces.notes , races.surveyavailable , races.photosAvailable , '0' , races.freedraw , icon1 , roadwarrior , calendarbannerbackground , calendarbannerenddate>=Now() , raceurl , bananareview , shortracename , region FROM `races` LEFT Join myraces ON races.raceCode = myraces.raceCode WHERE myraces.email = '' AND myraces.racetype = '1' AND races.yearMonthInt >= '202001' AND races.yearMonthInt < '202201' AND races.region = 'ON' ) UNION (SELECT DATE_FORMAT(`races`.`date`,"%a %b %e" ) as dateformat, races.year , LOWER(`races`.`staticRaceUrl`) as lstaticraceurl , LEFT( raceName , 40 ) as leftracename, `races`.`month` , `races`.`distance` , `races`.`raceCity` , CASE WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 2 ) = '5K' THEN CONCAT( '  Results5K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 2 ) = '8K' THEN CONCAT( '  Results 8K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 3 ) = '10K' THEN CONCAT( '  Results 10K ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 4) = 'Half' THEN CONCAT( '  Results Half ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' AND LEFT( distance , 8) = 'Marathon' THEN CONCAT( '  Results Marathon ' ) WHEN now() < date_add(date,interval 7 day) AND resultsAvailable = '1' THEN CONCAT( '  Results ' , races.distance , '' ) WHEN resultsAvailable = '1' AND LEFT( distance , 2 ) = '5K' THEN CONCAT( '  Results5K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 2 ) = '8K' THEN CONCAT( '  Results 8K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 3 ) = '10K' THEN CONCAT( '  Results 10K ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 4) = 'Half' THEN CONCAT( '  Results Half ' ) WHEN resultsAvailable = '1' AND LEFT( distance , 8) = 'Marathon' THEN CONCAT( '  Results Marathon ' ) WHEN resultsAvailable = '1' THEN CONCAT( '  Results ' , races.distance , '' ) WHEN LEFT( distance , 2 ) = '5K' THEN CONCAT( '   5K ' ) WHEN LEFT( distance , 2 ) = '8K' THEN CONCAT( '    8K ' ) WHEN LEFT( distance , 3 ) = '10K' THEN CONCAT( '    10K ' ) WHEN LEFT( distance , 4 ) = 'Half' THEN CONCAT( '    Half ' ) WHEN LEFT( distance , 8 ) = 'Marathon' THEN CONCAT( '    Marathon ' ) ELSE CONCAT( '    ' , races.distance , '' ) END AS distanceColumns , DATE_FORMAT( weekOfDate , "%W %M %d, %Y" ) as formatweek, races.raceCode , tentativeDate, calendarbanner, '0' as goalchecked, races.date as d, 'event' as eventName, '' , races.surveyavailable , races.photosAvailable , '0' , races.freedraw , icon1 , roadwarrior , calendarbannerbackground , calendarbannerenddate>=Now() , raceurl , bananareview , shortracename , region FROM `races` WHERE tentativeDate <= '1' and approved = '1' and races.yearMonthInt >= '202001' AND races.yearMonthInt < '202201' AND races.region = 'ON' ) ORDER BY d , leftracename , goalchecked DESC LIMIT 300, Table 'db174799.races' doesn't exist