Re: Syntax error converting character string to datetime
From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 05/28/04
- Next message: John Bell: "Re: Syntax error converting character string to datetime"
- Previous message: Aaron Bertrand - MVP: "Re: SQL Standard vs. SQL Personal Edition"
- In reply to: Wei: "Syntax error converting character string to datetime"
- Next in thread: John Bell: "Re: Syntax error converting character string to datetime"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 28 May 2004 10:02:44 -0400
> I need to transfer data from our legacy system to SQL
> server. But I got a error message when converting a
> character field to date type with data like '20020401'.
The suspicious word here is "like" ... this is one of the problems for
choosing a character column to store date (which is usually done so the user
can prettify the display in Enterprise Manager and see the date "stored" the
way they want them to be displayed).
You probably have one or more values in the column that is NOT a date.
SELECT COUNT(*) FROM SourceTable WHERE IsDate(column) = 0
-- Aaron Bertrand SQL Server MVP http://www.aspfaq.com/
- Next message: John Bell: "Re: Syntax error converting character string to datetime"
- Previous message: Aaron Bertrand - MVP: "Re: SQL Standard vs. SQL Personal Edition"
- In reply to: Wei: "Syntax error converting character string to datetime"
- Next in thread: John Bell: "Re: Syntax error converting character string to datetime"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|