Monday, February 20, 2012

Query string with quote

I want to connect to table of AS400 with a parameter(THE NAME OF TABLE IS
AVP.M002)
The following sentence execute correctly.
SELECT * FROM LIB01."AVP.M002" WHERE CDTAB= '007'
How will be the string with the parameter: Parameters!ParmCDTAB.Value
I was trying with the string , but it doesn't run
="SELECT * FROM LIB01."AVP.M002" WHERE CDTAB= '" &
Parameters!ParmCDTAB.Value &"'"
The problem is ( "AVP.M002") . How I build the string to execute correctly?Just try this (duplicate the double quotes):
="SELECT * FROM LIB01.""AVP.M002"" WHERE CDTAB= '" &
Parameters!ParmCDTAB.Value &"'"
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Walter" <Walter@.discussions.microsoft.com> wrote in message
news:2E79D5D2-0169-4F16-9308-0F8C124203F8@.microsoft.com...
>I want to connect to table of AS400 with a parameter(THE NAME OF TABLE IS
> AVP.M002)
> The following sentence execute correctly.
> SELECT * FROM LIB01."AVP.M002" WHERE CDTAB= '007'
> How will be the string with the parameter: Parameters!ParmCDTAB.Value
> I was trying with the string , but it doesn't run
> ="SELECT * FROM LIB01."AVP.M002" WHERE CDTAB= '" &
> Parameters!ParmCDTAB.Value &"'"
>
> The problem is ( "AVP.M002") . How I build the string to execute
> correctly?
>

No comments:

Post a Comment