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!

Concatenating SQL strings in VBA

Status
Not open for further replies.

chiangwei

Technical User
Sep 13, 2002
1
JP
I have a problem when concatenating strings in VBA

I have parts of a SQL query string stored in several cells in Excel which I concatenate to form SQL queries. The resulting SQL query looks correct but it doesn't work. I copied and pasted the exact same SQL query string saved into a text file and there was no problem.

Anyone have any idea why that happens?
 
Shouldn't be a problem - maybe you have some extra spaces or characters in your cells ?? Rgds
~Geoff~
 
...or not enough spaces???
Maybe the concatenated result looks like:

Select WhateverField FromWhateverTable Where...

It happens all the time...
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top