Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert DateTime to a string to send to SQL serv
Message
From
05/09/2010 10:24:21
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01480183
Message ID:
01480184
Views:
87
This message has been marked as a message which has helped to the initial question of the thread.
>Hi,
>
>I want to send to the SQL Server the following update command:
>
>
>"update MyTable Set DateTimeColumn = " + TTOC(DateTime()) + " where Pk = " + nPk
>
>
>The TTOC() does not seem to do the job as SQL Server returns an error. What would be the right syntax for sending the current Date and Time to update SQL Serrver column?
>
>TIA.


Dmitry,

I would try
ttoc(DateTime(), 1)
Update:

You may need to put the value between single quotes
[update MyTable Set DateTimeColumn = '] + TTOC(DateTime()) + [' where Pk = ] + nPk
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform