Hello,

I hae a table that has multiple records for the same EmpID with sales
amounts for each EmpID entry.
I am trying to SUM the SalesAmounts to create a quarterly report of total
sales by Employee.

<cfquery name="QuarterSales" datasource="EmpStats">
Select Distinct EmpID,
SalesAmount
>From EmpSales
Where Quarter = 1
</cfquery>

then I put it in cfgraph, as so:

<cfgraph type="bar" Title="Employee Quarterly Sales" Query="QuarterSales"
ValueColumn="SalesAmount" ItemColumn="EmpID" ColorList="blue,green">
</cfgraph>

Needless to say it shows Sales for each EmpID, repeating the same ID for as
many sales as their are.

I try this but to no avail:

<cfquery name="QuarterSales" datasource="EmpStats">
Select Distinct EmpID,
SUM(SalesAmount) as SalesSum
>From EmpSales
Where Quarter = 1
</cfquery>

Any Takers?

Thanks
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to