Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert date in sql server
Message
De
12/04/2006 13:32:12
 
 
À
12/04/2006 13:18:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01113026
Message ID:
01113031
Vues:
15
>i want to do a insert in a table with sqlexec
>
>table test
>
>field : tr_date,tr_currency
>
>i got an error when i do that
>
>"insert into table test (tr_date,tr_currency,tr_rate) values (" + date()+",'"+l_cur+"')"
>
>and i know is about the date()



You cannot mix strings with date types. Convert the date to a string in the desired format using DTOS() or DTOC() or some other function.

Also the whole "INSERT INTO" string has to go inside the SQLEXEC() function pointing to the proper open connection handle as first parameter. See SQLEXEC() in help for more details.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform