How can i concatenate the following string to make an SQL statement?
Dim sql = "SELECT * FROM users with (nolock) WHERE"
Dim sql2 = "(ownerID = '"
For Each item In arrExcelValues
sql2 = sql2 + item + "' or renterID = '" + item + "') or"
Next
I need it to look like this;SELECT * FROM users with (nolock) WHERE (ownerID = '12554' or renterID = '12554') or (ownerID = '32433' or renterID = '32433')
So when it reaches the end of the array it will not include the "or" . Thanks for any help.