Friends
I have one problem. I have one combobox on form. I used to send combobox value as parameter to crystal report. But as we know in sql query string should be in single quotes. how can i convert combobox value into single quotes and send as parameter to crystal report on button click event
Loading
Manikavelu VelayuthamPosted Nov 16, 2010, 12:28 AM
No need to pass the single quotes if you are using dynamic sql queries.
DECLARE @sqlCommand varchar(1000)
DECLARE @columnList varchar(75)
DECLARE @city varchar(75)
SET @columnList = 'CustomerID, ContactName, City'
SET @city = '''London'''
SET @sqlCommand = 'SELECT ' + @columnList + ' FROM customers WHERE City = ' + @city
EXEC (@sqlCommand)