I have been trying to work out how to query a database with MSSQL 2012 & CF 10 to output the totals of a days transactions in its own result set.
<cfquery name="myquery" datasource="#mydatasource#">
SELECT paid,orderTotalCost,orderTotalGST,orderID,orderCountry,orderDate,orderState
FROM storeOrders
WHERE paid = <cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.paid#">
AND orderDate BETWEEN <cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.startDate#">
AND <cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.endDate#">
</cfquery>
trying to output the data
Monday | 100
Tuesday | 200
Wednesday | 300
Thursday | 400
Friday | 500
Saturday | 600
Sunday | 700
My SQL Skills arent very good, so Im hoping someone on here could kindly help me out as to how to sum up the data and return it as its own column ?
thanks in advance