All Forums Tools
sheridany 12 posts Joined 04/06
12 Nov 2008
mask part of a numeric field

I have to mask the last 4 digits of a numeric field with xxxx within a sql statement. What is the easiest way to do that?

Adeel Chaudhry 773 posts Joined 04/08
12 Nov 2008

Hello,What I understood, following should be helpful:SELECT CAST('1234567890' AS VARCHAR(10)) AS A, LENGTH(A) AS B, SUBSTR(A, 1, B - 4) || 'xxxx';Regards,Adeel

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.