stored procedures - Nested select statements -


i trying return results based on number of cases if greater 0 when try execute stored procedure error stating: operand type clash: uniqueidentifier is incompatible tinyint. , nested select statement in clause.

select        o.officeid,       o.officename name,       at.description caseactivity,       sum(a.duration) [caseminutes],        cast(sum(a.duration) float) / 60 [casehours],         count(a.activityid) activities,       count(distinct a.caseid) cases,       min(cast(a.duration float) / 60) [case min time],       max(cast(a.duration float) / 60) [case max time],       sum(cast(a.duration float) / 60) / count(a.activityid) [case avg time],       sum(cast(a.duration float) / 60) [case totalhours]   activity       inner join activitytype @ on a.activitytypeid = at.activitytypeid       inner join activityentry ae on a.activityentryid = ae.activityentryid       inner join [case] c on a.caseid = c.caseid       inner join [office] o on ae.officeid = o.officeid       inner join [user] u on c.createdbyuserid = u.userid    a.caseid in(select a.caseid activity a.caseid > 1 , .dbo.dateonly(ae.activitydate) between @begindate , @enddate)   group          o.officeid,         o.officename,         at.description 

**desired goal stored procedure**
want return results stored procedure case count greater 0. stored procedure returns activities cases 0 or greater. interested in getting activities cases greater 0. in clause trying insert select statement filter results cases > 0.

the error message telling you.

one of comparisons comparing things 2 columns different types.

look @ table structures , see columns you're comparing has uniqueidentifier , have ints , @ sql , see ones you're comparing.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -