Clean up the sqlstring escapedate function