[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 70
  • Last Modified:

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
0
seamus9909
Asked:
seamus9909
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
try this

select val([nameOfField]) from tableX
0
 
Rey Obrero (Capricorn1)Commented:
you can also use

select cint([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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now