You are here:

# Using MS Access/Break a number into fields for billions, millions, thousands etc in an Access 2003 report

Question
In an Access (2003) report I need to break a number down into five separate fields to show the value for each component part: Billions, millions, thousands, hundreds, pence.
For example the number 9,862,956.18 to
[Millions] 9
[Thousands] 862
[Hundreds] 956
[Pence] 18
I'm trying to do this with field formulas first to get the value without "punctuation" =Replace(Replace([Field1],",",""),".","")
Then a very messy iif =IIf(Len([Field1])=14,Left([Field1],3)) etc etc but without success.
Is there a better way to achieve this?

Yes, Simply divide using the INT function.

Int(number/1000000) will get you the millions

INT((number-(INT(number/1000000)*1000000))/1000) will get you the thousands

INT((number-(INT(number/1000)*1000))) will get you the hundreds

number-INT(number) will get you the pence

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA
Questioner's Rating
 Rating(1-10) Knowledgeability = 10 Clarity of Response = 10 Politeness = 10 Comment Thanks for your prompt response and apologies for the delay in my responding - the AllExperts reply went to my junk mail! I did get my solution working but at the cost of some 60-odd hidden fields on the report. Needless to say I've adopted your approach!

Using MS Access

Volunteer

#### Scottgem

##### Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

##### Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA