Hi,
I noticed in one of the recent posts Brian said
You can use parameters to pass different values to the WHERE clause, but not actually change the conditions in it.
Does anyone have any examples of how to do this?
I've got an SQL Expression field which works fine when I hard code a value, but if i try and use a parameter i get an error that says
Error in compiling SQL Expression:
Failed to retrieve data from the database.
Details: ADO Error Code : 0x80040e10
Source: Microsoft OLE DB Provider for SQL Server
Description: No value given for one or more required parameters..
The code i'm using in the SQL Expression is
(Select "CONTRACT_REF_SEG_DESC"."CS_DESCRIPTION"
FROM "CONTRACT_REF_SEG_DESC"
WHERE LEFT("INVOICE_LINES"."IL_CUSTOMER_REF",(CHARINDEX('/',"INVOICE_LINES"."IL_CUSTOMER_REF",0)-1)) = "CONTRACT_REF_SEG_DESC"."CS_CODE"
AND
"CONTRACT_REF_SEG_DESC"."CS_ACCOUNT"={?AccountCode} )
Like I say if i replace the {?AccountCode} with an account name it works.
Is it possible to do this? If so any ideas where i'm going wrong?
I'm using MS SQL and CR XI.
Thanks.