SQL IN with identifier
Question
Application Type
Reactive

Hello.
I am making an advance SQL Query (cannot use normal aggregate for this). In this query, i needed to recieve a list, since that isnt possible, i am passing variable that will contain the ids separated by ','.
Something like :

{News}.[NewsType] IN (@SearchKeyWord)

Where SearchKeyWord is the variable that contains the id's separated by ','.

this gives me the following error:

Error in advanced query TotalCount: Error converting data type nvarchar to bigint.

I believe this error is cause because {News}.[NewsType] is of type identifier, and the SearchKeyWord is of type string.

How can i workaround this? Any help is appreciated! 

Hello Ricardo,

Is your SearchKeyword Expand Inline a yes? If not, try.

Regards,

Jorge Rodrigues

Select Count({News}.[Id])
from {News}

where {News}.[NewsType] IN @SearchKeyWord

test input:

"'60','59'"

Error in advanced query TotalCount: Incorrect syntax near '60'.

EDIT: when i place () on the @searchkeyword the error goes away! thanks for the help! :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.