I use Dynamic Query:
="Select dbo.UserList.UserID FROM dbo.UserList
WHERE dbo.UserList.IncidentID = " & Parameters!IncidentID.Value
While I built the solution I had:
The expression for the query ?DataSource2? contains an error: [BC30648]
String constants must end with a double quote.
Tried to play with quotes - nothing helps. What can be wrong?
Thank you in advance.I assume that IncidentID is a varchar or something like that. So you need to
enclose your parameter is single quotes. When figuring this out I usually
have a textbox that I set the expression to so I can see the result. What
you want is this:
="Select dbo.UserList.UserID FROM dbo.UserList WHERE dbo.UserList.IncidentID
= '" & Parameters!IncidentID.Value & "'"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Irina Pippin via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
message news:80756350b0964be882d691763129e7bd@.SQLMonster.com...
>I use Dynamic Query:
> ="Select dbo.UserList.UserID FROM dbo.UserList
> WHERE dbo.UserList.IncidentID = " & Parameters!IncidentID.Value
> While I built the solution I had:
> The expression for the query 'DataSource2' contains an error: [BC30648]
> String constants must end with a double quote.
> Tried to play with quotes - nothing helps. What can be wrong?
> Thank you in advance.|||another solution
=string.Format("Select dbo.UserList.UserID FROM dbo.UserList WHERE
dbo.UserList.IncidentID ='{0}' ", Parameters!IncidentID.Value)
"Irina Pippin via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
message news:80756350b0964be882d691763129e7bd@.SQLMonster.com...
>I use Dynamic Query:
> ="Select dbo.UserList.UserID FROM dbo.UserList
> WHERE dbo.UserList.IncidentID = " & Parameters!IncidentID.Value
> While I built the solution I had:
> The expression for the query ?DataSource2? contains an error: [BC30648]
> String constants must end with a double quote.
> Tried to play with quotes - nothing helps. What can be wrong?
> Thank you in advance.|||Cool, I'd never seen that solution before. I like it, especially if you have
multiple parameters.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Oleg Yevteyev" <myfirstname001atgmaildotcom> wrote in message
news:eRVfDfpUFHA.548@.tk2msftngp13.phx.gbl...
> another solution
> =string.Format("Select dbo.UserList.UserID FROM dbo.UserList WHERE
> dbo.UserList.IncidentID ='{0}' ", Parameters!IncidentID.Value)
> "Irina Pippin via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
> message news:80756350b0964be882d691763129e7bd@.SQLMonster.com...
>>I use Dynamic Query:
>> ="Select dbo.UserList.UserID FROM dbo.UserList
>> WHERE dbo.UserList.IncidentID = " & Parameters!IncidentID.Value
>> While I built the solution I had:
>> The expression for the query 'DataSource2' contains an error: [BC30648]
>> String constants must end with a double quote.
>> Tried to play with quotes - nothing helps. What can be wrong?
>> Thank you in advance.
>
No comments:
Post a Comment