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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with concatenating some SQL

Status
Not open for further replies.

colezpapa3

Programmer
Dec 8, 2007
73
US
Having a problem with this concatenation....
lID is numeric and docName is a string....

This is the original line....
str = "Select * from Issues WHERE LinkID = " & lID


I want to concatenate the following line and having some trouble....

DocumentName = '" & docName & "'


thx
 




Hi,
Code:
 str = "Select * from Issues WHERE LinkID = " & lID & " AND DocumentName = '" & docName & "'"


Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
Skip,

I believe I tried it that way and received an error message "Too few parameters...expected 1
 



That is bacause one of your FIELDS is incorrectly defined in your SQL.

Is LinkID a NUMERIC field? If TEXT, then you need 'delimiters'.

Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
Usually "Too few parameters...expected 1" means that you are specifying something as a field name that doesn't exist in the table. If the query started to fail when you added the "DocumentName = " clause then check the table to be sure that the field name really is "DocumentName".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top