fixed an issue with value_datetime when creating insert statements for the sql