cancel
Showing results for 
Search instead for 
Did you mean: 

Transferring string parameters in Crystal Reports

Former Member
0 Kudos

Hello there,

I am trying to transfer a string parameter in Crystal Reports in an expression like:

select mskey

from dbo.mxiv_sentries

where attrname = 'MSKEYVALUE' and

searchvalue ={?MSKEY}

For some reason this doesn't work. When I enter the parameter Z3AEM the error that is returned is:

'Invalid column name 'Z3AEM'. [Database Vendor Code: 207]

I googled this error some information about quotes and double quotes that might cause this error. My problem is that I have no control over how the string parameter is presented in the SQL which is sent to SQLserver. Transfering parameters of type numbers works fine, but there seems to be a problem with string parameters. I'm using Crystal Reports 2008.

Best regards,

Anders

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andreas

This could be because of the quotation settings on your db.

As long as you are running on a test system, try to do the following.

use database_name

go

set quoted_identifier off

Then you should be able to pass a query in Crystal Report ex:

select * from mxiv_sentries where searchValue=

Please advice since this is default set to "ON" I can not verify how it will affect other aspects of the idm solution.

Another suggestion is leaving the quotation setting ON, and use

select * from mxiv_sentries where searchValue like '{?MSKEYVALUE}'

Keep in mind if your mskeyvalues contains %* etc this is not a good idea.

Best regards

Roy Tronstad

Former Member
0 Kudos

Hello again,

Thanks for your answer. It turns out that this bit works:

select mskey

from dbo.mxiv_sentries

where attrname = 'MSKEYVALUE' and

searchvalue ='{?User-ID}'

I was under the impression that the quotation marks were implied once the parameter was typed as a string.

Best regards,

Anders

Answers (0)