That's exactly what I was looking for dave_the_m. Thanks for pointing me in the right direction. I just could not figure out how to do that with a split. That was my problem, I was trying a split alone without looping through the sql string and pulling out individual parts, which is what your while loop does. Thanks again.