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 2005 Forums
 Transact-SQL (2005)
 Letter removal

Author  Topic 

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2009-07-29 : 05:39:26
Can any one help me on this one.

I have over 30k rows of data that has got a 4 digit number in but about 4k have got letters either starting or ending in. The letters vary between a - x or aaa - xxx or a mixed bag. This table is repopulated nightly. I am also looking at how to count the digits in a cell and if it is greater than 4 then replace it with another column.


Many Thanks

Whitmoj
If I have inspired one person today then my job is done.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-29 : 06:20:14
you can use fnFilterString to extract the numeric or the alpha part from your value


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2009-07-29 : 06:45:27
Thanks it works a treat, Any suggestions how to count cell and if greater than 4 replace with another data

Whitmoj
If I have inspired one person today then my job is done.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-29 : 06:47:28
something like

case when len( <filtered with numeric> ) > 4
then <your replacement logic>
else . . .
end



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -