> <cfquery name="getDealers" datasource="#DSN#"> select id, 
> name from dealers where id = '#form.DealerName#'
> order by name
> </cfquery>
> 
> <cfxml variable="myxml">
>       <graph caption='Sample Chart' subCaption='(in 
> Percentage %)' yaxisname='# of Ads' xaxisname='Dealers' 
> numdivlines='3' zeroPlaneColor="333333" zeroPlaneAlpha='40' 
> numberSuffix='%'> <cfoutput query="getDealers">
>       <cfquery name="dealerAdsCount" datasource="#DSN#">
>               select count(*) as totalAdsCreated from 
> DealerAds where dealer = '#getDealers.id#'
>                               <cfif IsDefined('form.month1') 
> AND #form.month1# NEQ "A">
>                                       AND created BETWEEN 
> #startdate# AND #enddate#
>                               </cfif>
>                       </cfquery>
>                       <set name='#getDealers.name#' 
> value='#dealerAdsCount.totalAdsCreated#' /> 
>               </cfoutput>
>       </graph>
> </cfxml>
> 
> <!--- dump the resulting XML document object ---> <cfdump 
> var="#myxml#">
> 
> The above code somehow giving me the following error at the  
> line where I am using <set name=""......>
> 
> An error occured while Parsing an XML document.  
> Element type "set" must be followed by either attribute 
> specifications, ">" or "/>".

Perhaps there's an XML metacharacter in your getDealers.name variable?

On an unrelated note, I suspect you can simplify this quite a bit by using a
single query to get the ad count with the other dealer information. This
obviously untested query might work for you:

SELECT  d.id,
                d.name,
                COUNT(da.dealer)
FROM            dealers d,
                DealerAds da
INNER JOIN      d.id = da.dealer
<cfif IsDefined("Form.month1") and Form.month1 neq "A">
WHERE           da.created BETWEEN #startdate# AND #enddate#
</cfif>
GROUP BY        d.id
ORDER BY        d.name

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182717
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to