Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String parameter into SQL command

Status
Not open for further replies.

urya

MIS
Jun 5, 2003
5
US
Hi all,

I have a SQL command to setup a report in Crystal.
I created parameter field called paramVendorID, which is String, and try to filter out records.

I have:
WHERE (dbo.test1.VENDORID >= {?paramVendorID})

This somehow doesn't work if I have a number at the first character.
The command itself has no error. I get an error when I actually enter a param and run the query.
The error is:
Failed to open a rowset.
Details: AADO Error COde: 0x80040e14
Source: Microsoft OLE DB Provider for SQL Server
Description: Line15: Incorrect syntax near 'Y0003'
SQL State: 42000
Native Error: 170

The actual param value I entered is 3Y0003.
If I just put '3Y0003' into SQL command instead of the parameter value, it works fine.

Please help me.
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top