I moved my testing environment from a windows server to a linux server.
In doing so I had to migrate my DB from Access to MySQL. Everything
seems to be working fine except when I query a query. Here's the error
and the queries in question. The query that seems to be the perpetrator
is ChartSums. Any help would be appreciated. Also, my production server
is still windows / access based.
*Query Of Queries runtime error.*
The aggregate function [SUM(expression)] cannot operate on an
operand of type [VARCHAR].
<cfquery datasource="jhdsn" name="JobsMilesOut">
SELECT *
FROM JobsMiles
RIGHT JOIN Logins
ON JobsMiles.SubmittedBy = Logins.ID
<cfif #drs# IS 1>
WHERE ((JobsMiles.Date BETWEEN #CreateODBCDate(form.StartDate)# AND
#CreateODBCDate(form.EndDate)#))
<cfelse>
WHERE ((JobsMiles.Date BETWEEN
#CreateODBCDate(createDate(year(now()), month(now()), 1))# AND
#CreateODBCDate(Now())#))
</cfif>
ORDER BY Date
</cfquery>
<cfquery dbtype="query" name="ChartSums">
SELECT
LastName,
FirstName,
Sum(TotalMile) AS miles_sum,
Sum(expenses) AS expenses_sum
FROM JobsMilesOut
GROUP BY LastName, FirstName
</cfquery>
Thanks in advance!
~Steve Good
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270355
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4