Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select case when isnumeric(BilledWeight) = 1
then cast(BilledWeight as Integer)
else BilledWeight END as NewBilledWeight
from MyTable
[COLOR=blue]Select[/color] [COLOR=blue]Case[/color] [COLOR=blue]When[/color] [COLOR=#FF00FF]IsNumeric[/color](Billed_Weight + [COLOR=red]'.0e0'[/color]) = 1
[COLOR=blue]Then[/color] [COLOR=#FF00FF]Convert[/color]([COLOR=blue]VarChar[/color](20), [COLOR=#FF00FF]Convert[/color]([COLOR=blue]Int[/color], Billed_Weight))
[COLOR=blue]Else[/color] Billed_Weight
[COLOR=blue]End[/color] [COLOR=blue]As[/color] Billed_Weight
select case when isnumeric(BilledWeight) = 1
then cast(cast(BilledWeight as Integer) as varchar)
else BilledWeight END as NewBilledWeight
from MyTable
[COLOR=blue]create[/color] [COLOR=blue]table[/color] GarbageData (v [COLOR=blue]varchar[/color](666))
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000025'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000041'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000120'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000008'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'LTR'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000011'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000045'[/color])
[COLOR=blue]insert[/color] GarbageData [COLOR=blue]values[/color]([COLOR=red]'000077'[/color])
[COLOR=blue]select[/color] [COLOR=#FF00FF]replace[/color]([COLOR=#FF00FF]ltrim[/color]([COLOR=#FF00FF]replace[/color](v,[COLOR=red]'0'[/color],[COLOR=red]' '[/color])),[COLOR=red]' '[/color],[COLOR=red]'0'[/color])
[COLOR=blue]from[/color] GarbageData