After the loop has finished executing you will have this at the end of your string:
AND T1.A
and you need to trim that off as it will cause an error if you try to execute it.
Left() takes 2 arguments, the source string and an int value; basically it will return n number of characters from the left of the string up to n.
So:
Dim s
s = "foo"
Response.Write(Left(s, 1))
will output: f
Len() takes one parameter, a string, and returns an INT value of how many places exist in that string so
Len(s) will output 3
So my code: Left(sSqlLike, (Len(sSqlLike) - 10)) takes the source string and counts from the left most position to the end of the string, less 10 positions, as we need to remove the trailing 10 chars.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========