how to suppress leading zeroes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a text key in the fixed format "annn" and I need to
sometimes display it as "a n" (where n can be 1, 2 or 3 digits) whilst
maintaining the original field for sort purposes. I can separate the two
parts easily enough and put back together with a space between, but I cannot
see how to display the numeric part as a number without leading zeroes. Is
this because it is text? Any ideas?
 
I have a table with a text key in the fixed format "annn" and I need to
sometimes display it as "a n" (where n can be 1, 2 or 3 digits) whilst
maintaining the original field for sort purposes. I can separate the two
parts easily enough and put back together with a space between, but I cannot
see how to display the numeric part as a number without leading zeroes. Is
this because it is text? Any ideas?

[fieldname] = "A0023"

Val(Right(FieldName],4)) = 23
 
kwizzy said:
I have a table with a text key in the fixed format "annn" and I need to
sometimes display it as "a n" (where n can be 1, 2 or 3 digits) whilst
maintaining the original field for sort purposes. I can separate the two
parts easily enough and put back together with a space between, but I cannot
see how to display the numeric part as a number without leading zeroes. Is
this because it is text?

Yes it is because it's text. Just convert the second part
to number

part1 & " " & CLng(part2)
 
ta muchly

fredg said:
I have a table with a text key in the fixed format "annn" and I need to
sometimes display it as "a n" (where n can be 1, 2 or 3 digits) whilst
maintaining the original field for sort purposes. I can separate the two
parts easily enough and put back together with a space between, but I cannot
see how to display the numeric part as a number without leading zeroes. Is
this because it is text? Any ideas?

[fieldname] = "A0023"

Val(Right(FieldName],4)) = 23
 
Back
Top