Convert to DateTime
From: Elmo Watson (sputnik75043_at_nospam.Yahoo.com)
Date: 03/01/04
- Next message: Steve Kass: "Re: Convert to DateTime"
- Previous message: Erland Sommarskog: "Re: RAISERROR descriptions"
- Next in thread: Steve Kass: "Re: Convert to DateTime"
- Reply: Steve Kass: "Re: Convert to DateTime"
- Reply: Andrew John: "Re: Convert to DateTime"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 29 Feb 2004 19:01:33 -0600
Unfortunately, I've inherited a database with a field which has been adding
dates and times, but it's been using an nvarchar field .
Most of the strings are in this format:
Mon Oct 13 12:58:00 2003 EST
but of course, there are still strings that will convert to date and time
more easily like:
4/11/2003 9:29:53 AM
I've tried doing a left/right/update scenario to remove the Day and EST
strings, but then, I'm left with strings like:
Oct 13 12:58:00 2003
I really would like to convert it to a date/time field, but even with that,
apparently it doesn't like the Oct and gives me an error:
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error
converting datetime from character string.
Anyone have any ideas on how I can do this in as few steps as possible?
- Next message: Steve Kass: "Re: Convert to DateTime"
- Previous message: Erland Sommarskog: "Re: RAISERROR descriptions"
- Next in thread: Steve Kass: "Re: Convert to DateTime"
- Reply: Steve Kass: "Re: Convert to DateTime"
- Reply: Andrew John: "Re: Convert to DateTime"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|