>Hi Sergey.. I have the date working now.
>
>I used "'" + Dtos(MyDate) + "'"
>So a combination of Dtos and single quotes seemd to work.
And it will work with default settings for USA - i.e. set date American (not ANSI, which is supposed to be "standard American" :), and the corresponding setting in your ODBC and SQL. Once one of these gets set differently, you'll end up with the end-of-XIX-century type of date, or just null, in your SQL-side datetime fields.
For a more general approach, I use this:
#define s_quote ["]
tcValue=C_SQUOTE+transform(ttoc(tuvalue,1), "@R 9999-99-99 99:99:99")+C_SQUOTE
and that's the value that gets inserted for a datetime value. For just dates, omit the "99:99:99" part. This format is not ambiguous and will pass unscathed through ODBC.
For MYSQL it's even simpler: use ttoc(tuValue, 1).