Here is my query as it stands right now
variable useYear is set to now()
SELECT riderId, Month(rideDate) AS rideMonth, rideDistance
SUM(CASE WHEN Month(rideDate)='1' AND Year(rideDate)='Year(useYear)'
ELSE 0) AS jan
GROUP BY riderId, Month(rideDate)
ORDER By riderId, Month(rideDate)
I am attempting to find the sum per riderId for each month (only January is
shown above right now) if there is no data for a riderId in January, then set
currently I get
Syntax error (missing operator) in query expression 'rideDistance SUM(CASE
WHEN rideMonth='1' THEN rideDistance ELSE 0)'.