| || |
Trying to send date to SQL Server
I'm having a problem trying to send a date and time value to SQL Server and I think it's because SilkPerformer doesn't seem to have a datatype compatible with SQL Server's datetime type.
I need to get the current date and time and send it to SQL Server in the format (YYYYMMDD HH:MM:SSS). To do this I get the current date and time and then use FormatDateTime to get the format I want, however it is returned as a string.
When I try to post this I get the error message 'Error converting data type varchar to datetime'.
If I post the recorded SQL I got when I captured it works, but when I get the time as I need to it fails.
INSERT into dbo.details (date,name,address) VALUES ('20021111 10:30:124','Paul','UK');
this will work, but this doesn't
INSERT into dbo.details (date,name,address) VALUES (::v_sDateTime,'Paul','UK');
Thanks in advance.
Re: Trying to send date to SQL Server
My mistake... I was sending wrong code to FormatDateTime which wouldn't match the database... doh!! I'm ok sending this as a string.