You have to have the tables and the database to do this.. No tables, improper data types, will cause this to fail.

You should be able to roll back your sleeves, take your code and integrate what has been given to you. You are going to have to do some of this yourself. In other words, what I am trying to say is that my code would not work with your current database structure. I only posted it (and probably too much) to show the db connection.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's