Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to format a field in a query

Posted on 2016-10-20
4
Medium Priority
?
66 Views
Last Modified: 2016-10-21
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
Comment
Question by:seamus9909
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41853180
try this

select val([nameOfField]) from tableX
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 41853181
you can also use

select cint([nameOfField]) from tableX
0
 
LVL 22
ID: 41853182
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
 

Author Closing Comment

by:seamus9909
ID: 41853891
Thank you so Much
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question