Cost of incindents by organisation

syarlett's picture

Hi,



Can someone translate this for me?

Wheni try run the report under helpdesk for the Cost of Incidents by Organisation i get the following error...





Sql error in query. Error: System.Data.SqlClient.SqlError: Operand type clash: uniqueidentifier is incompatible with intSql CommandText: -- MAX ROWCOUNT SET ROWCOUNT 50000 -- SELECT '$' + STR(ROUND(SUM(ISNULL(wcv.[actual_workitem_hourly_rate], 80) * wcv.[workitem_minutes_spent]/60.0), 2), 10, 2) AS 'Total Cost', ROUND(SUM(wcv.[workitem_minutes_spent]), 2) AS 'Total Minutes Spent', '$' + STR(ROUND(SUM(ISNULL(wcv.[actual_workitem_hourly_rate], 80) * (wcv.[workitem_minutes_spent]/60.0))/(COUNT(*)), 2), 10, 2) AS 'Avg Cost', avg(hc.workitem_total_minutes_spent) AS 'Avg Minutes Spent', COUNT(distinct hc.workitem_number) AS '# Items', wcv.[contact_organization_name] AS 'Organization' FROM dbo.HD_workitem_cost_view wcv inner join dbo.HD_workitem_current_view hc on hc.workitem_number=wcv.workitem_number WHERE LOWER(wcv.[workitem_status_lookup_value]) LIKE LOWER('%') AND (UPPER(wcv.[managed_object_organization_name]) LIKE UPPER('%') OR UPPER(wcv.[contact_organization_name]) LIKE UPPER('%')) AND UPPER(wcv.[workitem_priority_lookup_value]) LIKE UPPER('%') AND UPPER(wcv.[workitem_category_tree_value]) LIKE UPPER('%') GROUP BY wcv.[contact_organization_name]





Regards Steve

Dominiqueg's picture

Hello,



- Is it a custom report or the original from Altiris?

- Are you using SQL 2000 or 2005?



I ran the statement in SQL 2005 on my server and everything is fine I have the report...



$ 0.00 0 $ 0.00 0 5

$ 108.00 81 $ 0.07 6 34 Dept1

$ 2.67 2 $ 2.67 2 1 Org Dept\Dept1

$ 0.00 0 $ 0.00 0 1 Org Dept/dept



Thanks,

Dom

Dominiqueg's picture

Anyway I search a little bit more and found this article



KB40137



Thanks,