Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Report Error

Author  Topic 

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-15 : 23:56:54
Hi All,

I have a report which gives count of various fields based on 4 parameters : Location,User,FromDate,Todate.
The user must first select a location and then he gets the corresponding UserNames(User parameter).
Then he selects a date range.

Now, if i make the user parameter multi-valued, it is not working. it works only for single value....

The error is : Error converting varchar type to int.
But i have given the datatype same as in tables..
Pls help.

The code is :
Select UserName as 'User Name'
,isnull(( Select Sum(HC_REQ_TEAM.Position)
From HC_REQ_TEAM WITH(NOLOCK)
WHERE HC_REQ_TEAM.TeamUserID=HC_USERS.RID
AND HC_REQ_TEAM.ReqID in
(Select RID
From HC_REQUISITIONS WITH(NOLOCK)
WHERE HC_REQUISITIONS.ClientID in
(16,15,13,14 ))
and HC_REQ_TEAM.ReqID
in(Select ReqID
From HC_REQ_RESUME,HC_REQ_RESUME_STATUS WHERE HC_REQ_RESUME_STATUS.StatusDate
between (@fromdate ) and (@todate)
and HC_REQ_RESUME.RID=HC_REQ_RESUME_STATUS.ReqResumeID ) )
,'') as Openings
From HC_USERS WITH(NOLOCK)
WHERE HC_USERS.RID in (@rid)
AND HC_USERS.Locationid in (@locid)
Group By HC_USERS.RID,HC_USERS.UserName
END

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-15 : 23:58:09
Sorry i could not save the indents i made.

Here i have given only a part of the query. that isnull part repeats for 10 columns.
Go to Top of Page
   

- Advertisement -