Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Date to SQL DateTime
Message
De
19/03/2007 14:14:43
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01205160
Message ID:
01205667
Vues:
16
>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).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform