macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: Query Help

Subject: Re: Query Help
From: "2onboard"
Date: Wed, 8 Aug 2007 19:23:21 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
Now stand at:

 SELECT riderId, Month(rideDate) AS rideMonth,
        SUM(CASE WHEN Month(rideDate)=1 AND Year(rideDate)=Year(useYear)
                THEN rideDistance
                ELSE 0)
                END AS jan
 FROM mileageLog
 GROUP BY riderId, Month(rideDate)
 ORDER By riderId, Month(rideDate) 

 and receive error message:
 Syntax error (missing operator) in query expression 'SUM(CASE WHEN 
Month(rideDate)=1 AND Year(rideDate)=Year(useYear) THEN rideDistance ELSE 0) 
END'. 


<Prev in Thread] Current Thread [Next in Thread>