Question
QofQ error
Hi i am getting a error of
Error Executing Database Query.
Query Of Queries runtime error.
The aggregate function [SUM(expression)] cannot operate on an operand of type [VARCHAR].
i have 2 columns in mysql database which are both DECIMAL fromats
i need to have a QofQ which i need but not sure how to change the queries to stop the error
<cfquery name="GetRecords" datasource="#application.ds#">
Select DateOfSM, RCODE, DAY(DateOfSM)as month3, OurCost, ClientCostPerSMS
FROM sms_records
WHERE MONTHNAME(DateOfSM)='#session.Daily#' AND YEAR(DateOfSM)=#session.DayYear#
</cfquery>
<cfquery name="GetRecords2" dbtype="query">
Select sum(OurCost)as TotalIncome, sum(ClientCostPerSMS)as Totalcost, month3
FROM GetRecords
GROUP BY month3
</cfquery>
Error Executing Database Query.
Query Of Queries runtime error.
The aggregate function [SUM(expression)] cannot operate on an operand of type [VARCHAR].
i have 2 columns in mysql database which are both DECIMAL fromats
i need to have a QofQ which i need but not sure how to change the queries to stop the error
<cfquery name="GetRecords" datasource="#application.ds#">
Select DateOfSM, RCODE, DAY(DateOfSM)as month3, OurCost, ClientCostPerSMS
FROM sms_records
WHERE MONTHNAME(DateOfSM)='#session.Daily#' AND YEAR(DateOfSM)=#session.DayYear#
</cfquery>
<cfquery name="GetRecords2" dbtype="query">
Select sum(OurCost)as TotalIncome, sum(ClientCostPerSMS)as Totalcost, month3
FROM GetRecords
GROUP BY month3
</cfquery>