how to format a field in a query

I have a column that is created that has 3 characters long

As an example the query could return

001
010
123

I want to format the field so that only the digits appear, no leading 0's so my desire is to show:

1
10
123
seamus9909Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
you can also use

select cint([nameOfField]) from tableX
0
 
Rey Obrero (Capricorn1)Commented:
try this

select val([nameOfField]) from tableX
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
turn on properties -- press Alt-Enter if it is not showing
then click in the column you want to format on the grid

in the Format property, type your format code -- or edit what is already there.

However, it could be that text is stored, not a number.  In that case, you can use a conversion function to turn it into a number. For instance:
MyNumber: CInt([MyTextFieldname])

Open in new window

Perhaps what you really want is to change the data type to a number?
0
 
seamus9909Author Commented:
Thank you so Much
0
All Courses

From novice to tech pro — start learning today.