Guys, I'm trying to create a statement that will allow me to have more then 254 values in an in statement. I'm trying to do this with the following statment. When I try to use it I get a scripttimeout error, even if I increase the timeout. I'm baffaled, I don't know what the problem could be. Any help would be aprreciated.
Thanks for taking the time to look at my code.
'88888888
dim arrWords, iLen, icounter, counter, inValues
const divider = 254
arrWords = split(strInstruments,","
iLen = UBound(arrWords)
iLen = iLen / divider
icounter = ubound(arrwords)
counter = 0
stop
do while icounter <> 0
if counter <= 254 then
inValues = inValues & arrwords(counter + counterMod) & ","
else
strSQL = strSQL & " AND band_reserve.reserve_number IN ('" & inValues & "')"
if counter = 255 then
tempSql = tempSql & strSQL & " union "
inValues = arrwords(counter + counterMod)
counterMod = counter + counterMod
counter = 1
else
tempSql = tempSql & strSQL
icounter = 0
end if
counter = 1 + counter
end if
loop
strSQL = tempSql
'88888888
Thanks for taking the time to look at my code.
'88888888
dim arrWords, iLen, icounter, counter, inValues
const divider = 254
arrWords = split(strInstruments,","
iLen = UBound(arrWords)
iLen = iLen / divider
icounter = ubound(arrwords)
counter = 0
stop
do while icounter <> 0
if counter <= 254 then
inValues = inValues & arrwords(counter + counterMod) & ","
else
strSQL = strSQL & " AND band_reserve.reserve_number IN ('" & inValues & "')"
if counter = 255 then
tempSql = tempSql & strSQL & " union "
inValues = arrwords(counter + counterMod)
counterMod = counter + counterMod
counter = 1
else
tempSql = tempSql & strSQL
icounter = 0
end if
counter = 1 + counter
end if
loop
strSQL = tempSql
'88888888