I can't comment on your code specifically because it's not in V6.0 format, but if you can repost it in that form I'll be glad to look at it.
In the mean time, what database are you using? How are you communicating with the database? What is the structure of the table you are storing the data in? In particular, what datatype are you using for the data?
If you are using SQL to insert and query the data, also post those statements.
Mike...