Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how i get the 0 in the beginning of the numbers

hi all,

i would like to know how i can show number 0 in this example:

i have field name Serial and the contact like that: "CCA 0101000","CCA 0101002","CCA 0101003"

"it 11 characters after CCA have space" and when i need to show just numbers i user that code: max(right(Serial , 7)) as S.N

the result i get is : "101000","101002","101003"

how can i show the first 0 by code?

thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Another option if you must use the Max function:

MAXSTRING(RIGHT(Serial, 7)) AS S.N



View solution in original post

8 Replies
syed_muzammil
Partner - Creator II
Partner - Creator II

Hi,

Max will return the numeric value therefore you don't get a 0. If the 0 is always ther in the field then you just append a 0 to the Max field.

'0'&Max(....) as SN

Regards,

Syed Muzammil.

Not applicable
Author

try this:

text(right(Serial , 7)) as S.N

Not applicable
Author

Try put mask in your result

Ex.:

=Num(max(right((Serial , 7)), '0000000')

Anonymous
Not applicable
Author

Another option if you must use the Max function:

MAXSTRING(RIGHT(Serial, 7)) AS S.N



Not applicable
Author

thanks jsomsen it´s working ... your answer is perfect... thanks alot

Not applicable
Author

Even right(Serial , 7) as S.N will work...Just remove the max() from your code and check it...

Not applicable
Author

i can´t remove the max because i need to get the last Serial .... thanks

Not applicable
Author

also with jsomsen answer to user maxstring i not need to divide the cell with "right"