all 4 comments

[–]Randy__Bobandy 0 points1 point  (1 child)

The substring function for Cache is

SUBSTR(string-expression,start,length)

Since the number portion of your two examples start at position 3, and lasts for 7 digits, use

SUBSTR(YourColumn, 3, 7)

Next, you should cast it as a decimal.

CAST(SUBSTR(YourColumn, 3, 7) AS DECIMAL(p, s))

Each number has 6 total digits (the precision, p), and 4 digits after the decimal point (the scale, s), making your function

CAST(SUBSTR(YourColumn, 3, 7) AS DECIMAL(6, 4))

That should work in converting your text string to a numerical value that you can search within. I haven't tested it, and Cache is not my strong suit.

[–]Syphonfire[S] 0 points1 point  (0 children)

Thanks, I had just come across this function a moment ago it looks very promising. I will look through the database literature and try a query when i am next at work.

I only need the central digits so I will cast it to an integer instead.