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

Re: Query Help

Subject: Re: Query Help
From: Ian Skinner
Date: Wed, 08 Aug 2007 12:43:31 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion

SUM(CASE WHEN Month(rideDate)=1 AND Year(rideDate)=Year(useYear)
                THEN rideDistance
                ELSE 0)
                END AS jan

I beleive your closing paran in in the wrong place. 'END' is part of the CASE statement and thus needs to be included in the SUM() function
I.E.
SUM(CASE WHEN Month(rideDate)=1 AND Year(rideDate)=Year(useYear)
                THEN rideDistance
                ELSE 0
                END) AS jan

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