?
Solved

how to format a field in a query

Posted on 2016-10-20
4
Medium Priority
?
60 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…
Suggested Courses

770 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