Board index » delphi » Syntax error converting datetime from character string (MS SQL 2K)
Juan Rosique
![]() Delphi Developer |
Syntax error converting datetime from character string (MS SQL 2K)2005-02-10 06:48:43 AM delphi212 Hi to all! Has anyone come across this error :"Syntax error converting datetime from character string." with SQL server? Here's my dilemma: I'm porting a legacy application to Delphi 7 with MS SQL as the backend, when I tried to import a record from the legacy tables that happens to have a datetime corresponding column on the SQL side, I get this error. The data coming in from the legacy file is formatted as YYYYMMDDHHMMSS. I have tried every possible format I have come across, but still get the error. I tried these formats: MM/DD/YY HH:MM:SS [AM/PM] - Did Not Work MM-DD-YY HH:MM:SS [AM/PM] - Did Not Work YYYY-MM-DD HH:MM:SS [AM/PM] - Did not work either I wrote a program that reads the records in the legacy table, and then tries to insert them into the SQL table. I need to preserve the time portion and I don't want to add a new column to the SQL table to hold this value. Can anyone help me? |