Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Changing Date

Author  Topic 

doggi3
Yak Posting Veteran

62 Posts

Posted - 2004-09-15 : 00:26:49
I have a column with entries like 13-Sept-1980.
I will like to change it to 13/09/1980.

How do I do so?

When Jan = 01, Feb = 02...etc
Also, changing the "-" to "/".

- HELP -

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-09-15 : 00:28:36
search date functions in BOL
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-09-15 : 00:40:27
declare @dt as varchar(20)
SET @dt='13-sep-1980'

print convert(datetime,@dt,103)

This is working for 13-sep-1980 i dont know how to make it work for 13-sept-1980




mk_garg
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-09-15 : 00:44:31
How about this

update table1 set col=REPLACE(col,'-','/')
update table1 set col=REPLACE(col,'SEPT','09')

Please dont post it more than once.







mk_garg
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-09-15 : 00:51:55
quote:
Please dont post it more than once.

I second that notion.....
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=39892
Go to Top of Page

doggi3
Yak Posting Veteran

62 Posts

Posted - 2004-09-15 : 00:58:30
Please dont post it more than once.[/quote]

-----------------

Sorry.





- HELP -
Go to Top of Page
   

- Advertisement -