SQL 2000 reporting services. I have a report based on a stored proc and I am passing a 'Group1' parameter which consists of a concatenation of two fields and some literal text that is used for grouping and a textbox on the report. Sample for parameter Group1
This works fine. Also if I test the stored proc using the query analyzer it works fine. Sample
Here is a part of the stored proc
The problem comes in when I try to call report from a VB.net program by building the URL and displaying the report in browser control in the program. If I only specify one field in the Group1, it works fine. But if I try and concatenate two fields or some literal text it gives me an error "Incorrect syntax near the word 'To'. I've tried eliminating the literal and just passing
then I get an error "Incorrect syntax near the keyword 'as'. I guess I can change how I'm doing the grouping. Just wondered if there was a simple fix. Thought I would try here before posting in the vb.net forum.
Auguy
Northwest Ohio
Code:
'Zip ' + ShipZip + ' To ' + DestZip
Code:
set @Group1 = '''Zip '' + ShipZip + '' To '' + DestZip'
Code:
...
Declare @SqlCommand varchar(4000)
Set @SqlCommand = 'Select ' + @Group1 + ' As GroupBy
...
Begin
Execute (@SqlCommand)
End
Code:
&Group1=ShipZip + DestZip
Auguy
Northwest Ohio