Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-30-2002, 11:16 AM   #1
marchristensen
Guest
 
Posts: n/a
Formatting Numbers

I have an Access report with two columns (fields). Column 1 is a text description and Column 2 is a number. I need Column 2 to be in number format so I can perform some calculations. I also need different number formats to appear in Column 2.

One record might have an entry of 30000 which I need to appear as 30,000 with no decimal places. Another number might be 0.1234 where I need four decimal places to appear with the leading 0. Another number might be 300.050 in which I need the final 0 to appear. Another number might be .025 which I need to appear as 2.50% How can I make this happen?

Thanks

  Reply With Quote
Old 10-30-2002, 01:43 PM   #2
Travis
Registered User
 
Travis's Avatar
 
Join Date: Dec 1999
Location: Kingsburg, CA, USA
Posts: 1,332
Thanks: 0
Thanked 2 Times in 2 Posts
Travis is on a distinguished road
The question I have to ask is this:

What are the rules?

How do you know how the number needs to be formated?

If the rule is in the Record or is definable, then an field that has a control source of a function can be used to set the value. But the most important part is figuring out what is the rule.
__________________
Travis L Abrahamson

Travis is offline   Reply With Quote
Old 10-30-2002, 01:51 PM   #3
marchristensen
Guest
 
Posts: n/a
Rules are based on record number

Travis
Thanks for answering so quickly. There are 'rules' but not in the traditional sense of the word. The rules are based on record number. The first record in the report will always have no decimal places and need a comma in the thousands. The second record of the report will always need three decimal places
BUT
As I am writing this, I think you have absolutely come up with the solution. I will add a third field to the table which will determine how the number in the second field is displayed. If the third field entry is 'thousands', I will display the number as thousands, with no decimal places. If the third field entry is 'threedec', I will display the second field with three decimal places. I think that will work very nicely.

Do you have a better idea?
Thanks again.
Lynn

  Reply With Quote
Old 10-31-2002, 12:18 PM   #4
Travis
Registered User
 
Travis's Avatar
 
Join Date: Dec 1999
Location: Kingsburg, CA, USA
Posts: 1,332
Thanks: 0
Thanked 2 Times in 2 Posts
Travis is on a distinguished road
No, that was where I was going with my questions.
__________________
Travis L Abrahamson

Travis is offline   Reply With Quote
Old 11-02-2002, 08:00 PM   #5
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,378
Thanks: 15
Thanked 1,619 Times in 1,537 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Your table structure sounds over-normalized. A rare event for this forum.

Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 09:19 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World