dfwcharles
Technical User
I have some character strings that look like this:
PM-FV-CARS-TRUCKS-5k
PM-FV-CARS-TRUCKS-10k
PM-FV-CARS-TRUCKS-100k
I would like to get just the number out of the string.
i tried using this:
declare @jpnum varchar(25)
set @jpnum = 'PM-FV-CARS-TRUCkS-100k'
select substring(@jpnum,19,(len(@jpnum)-len(right(@jpnum,charindex('k',@jpnum)-1))))
but it returns the number plus the K eg; "5K", "100K"
I need it without the K.
Any ideas?
Thanks
PM-FV-CARS-TRUCKS-5k
PM-FV-CARS-TRUCKS-10k
PM-FV-CARS-TRUCKS-100k
I would like to get just the number out of the string.
i tried using this:
declare @jpnum varchar(25)
set @jpnum = 'PM-FV-CARS-TRUCkS-100k'
select substring(@jpnum,19,(len(@jpnum)-len(right(@jpnum,charindex('k',@jpnum)-1))))
but it returns the number plus the K eg; "5K", "100K"
I need it without the K.
Any ideas?
Thanks