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.
Author |
Topic |
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-10-20 : 01:04:42
|
Dear All, I need to get the Ref.Number from The following linesin first line i need FF074 2 nd line OE0023 rd line OE0024 th line OE002... like thatThe length of the rearks sholud be differ..Acquisition of FF074 on 01 Jan 2004Transfer of cumulative depreciation ofOE002-Sold on creditTransfer of cumulative depreciation ofOE002-Sold on creditRetirement of Asset IdOE002-Sold on creditRetirement of Asset IdOE002-Sold on creditLoss on retirement ofOE002Loss on retirement ofOE002Acquisition of OE020 on 26 Feb 2004Is it possible to get the perticular value..?ThanksKrishna |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-20 : 04:30:03
|
[code]declare @test table (txt varchar(8000))insert @testselect 'Acquisition of FF074 on 01 Jan 2004' union allselect 'Transfer of cumulative depreciation ofOE002-Sold on credit' union allselect 'Transfer of cumulative depreciation ofOE002-Sold on credit' union allselect 'Retirement of Asset IdOE002-Sold on credit' union allselect 'Retirement of Asset IdOE002-Sold on credit' union allselect 'Loss on retirement ofOE002' union allselect 'Loss on retirement ofOE002' union allselect 'Acquisition of OE020 on 26 Feb 2004'select substring(txt, patindex('%[a-z][a-z][0-9][0-9][0-9]%', txt), 5) from @test[/code]Peter LarssonHelsingborg, Sweden |
|
|
|
|
|