Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert date in sql server
Message
From
12/04/2006 13:32:12
 
 
To
12/04/2006 13:18:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01113026
Message ID:
01113031
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform