Calculating percentage from 2 sql queries. How? Help!!
Here are my 2 queries. how do I calculate the percentage of both.
<cfquery name="gettotals" datasource="#request.dsn#">
SELECT count (*) as total
FROM transactions
where product_number=4
</cfquery>
<cfquery name="getrepurchases" datasource="#request.dsn#">
SELECT SUM(Duplicates.TotalCount) as repurchasesum FROM (SELECT email, COUNT(*)
TotalCount
From [dev].[dbo].[transactions]
where product_number=4
Group By email
HAVING COUNT(*) > 1) AS Duplicates
</cfquery>
Help Please...
