Converting Text - SQL

Baz

Baz

Soldato
Joined
9 Dec 2002
Posts
4,375
Location
Peterborough
Another day, another problem...

If I have a text column in a table, where all the text is in the format '13.3.2007' how can I convert each row in it to a smalldatetime field?


Thanks
:)
 
easiest way will be to create a new column as the datetime type and update all the row followed by a drop column command to drop the old text column.

smalldatetime should be directly created from that text format, what RDBMS are you using?

Paul
 
Using SQL 2000 :)

What it is, is I am importing a load of text files into a temporary table, then from there moving it to a static table, on the way through I have put in amongst the Insert-Select statement 'CAST (Field_name AS SMALLDATETIME)' and see if it works.....
 
And it works....


This place has a aura about it, like IT support people, you have a problem, come here and post asking for help, minutes later you fix it.... :p
 
I've been doing bits and pieces of support for the last 8 years. You get the the point where you can connect to remote machines via neural pathways through the internet to fix problems.

Much faster than talking to users ;)

Paul
 
happytechie said:
I've been doing bits and pieces of support for the last 8 years. You get the the point where you can connect to remote machines via neural pathways through the internet to fix problems.

Much faster than talking to users ;)

Paul

Neural pathways?

Thats SOOO last year.
 
Back
Top Bottom