× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



When you say the value can be of different sizes, what exactly do you mean?

If a field in a file is defined as numeric(6,0), do consider its "size" as 6 digits?  Or do you mean the size as in the number of digits not counting leading zeros?

For example, if the value of the numeric(6,0) is 000123, is the size 6?  Or is it 3?

If the latter, something like this should work as long as the value has a "size" of at least 4 (e.g. a value of at least 1000):

repeat('*',length(varchar(MyField)) - 4) concat right(varchar(MyField),4)

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx
pdow@xxxxxxxxxxxxxx /


On 6/29/2022 2:57 PM, Code 1109 via RPG400-L wrote:
Hello all, I'd like to seek a suggestion on how using SQL mask a numeric value, the value can be of different sizes so I'd like to only list the last 4 numbers and mask '*' the rest, sample:
I'd use a Select statement and select the field but before displaying it I want to mask it and only allow for the last 4 digits to be readable
1234567890 mask as ******7890 (six asterisks from the beginning)12345678 as ****5678 (four asterisks)
thanks in advanceRamon S.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.