I can't remove the quote_literal() because the value could potentially be a string, time, or number. Without the loop, quote_literal() handles the variable being any one of those types without any issues and quotes (or doesn't) as needed.
-- Keith Fiske Database Administrator OmniTI Computer Consulting, Inc. http://www.keithf4.com