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)
 Date copy

Author  Topic 

rjrferreira
Starting Member

13 Posts

Posted - 2007-08-09 : 08:28:12
I all!

I have a data table, tha as a new field, a datetime field.

In other field (varchar) i have some information. In some cases i have a string with a datetime inside. something like this:

"lsdhfsdf 24/07/2006 sdoçgj dsçf dfjsç"

So what i want is to copy just the date from this field to the new one.
I tried yet with regular expressions but doesn't work.

any ideas?

Greetings!
Rodrigo

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-09 : 08:45:44

Select dbo.GetCharacters('lsdhfsdf 24/07/2006 sdoçgj dsçf dfjsç','0-9/')

Make use of GetCharacters from
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56713

Also use proper datatype to store data and dont store everything in a single column


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -