Solved

format Currency, revmove decimals

Posted on 2013-12-05
12
359 Views
Last Modified: 2013-12-07
Experts,

I am trying to remove the decimals and format as currency.  Is below correct?   thanks

USD Equivalent: Format(IIf([tblCurrencyExchange].[CurrencyID]=1,"",Format(([tblFXRates]![Amount]*[tblCurrencyExchange]![ExchangeRate]),"Currency","#")))
0
Comment
Question by:pdvsa
  • 7
  • 5
12 Comments
 
LVL 19

Accepted Solution

by:
Eric Sherman earned 350 total points
ID: 39698476
Try this ...

USD Equivalent: Format(Round(IIf([tblCurrencyExchange].[CurrencyID]=1,"",[tblFXRates]![Amount]*[tblCurrencyExchange]![ExchangeRate]), 0),"$#,##0")



ET
0
 

Author Closing Comment

by:pdvsa
ID: 39698563
OK thanks.
0
 

Author Comment

by:pdvsa
ID: 39698565
OK thanks.

It is a little odd that I get a #error on only one particular record.  Would you know why?  
error on one record
0
 

Author Comment

by:pdvsa
ID: 39698573
the [Amount] and [tblCurrencyExchange]![ExchangeRate] are populated...little odd would get that error.  
recopied here:
USD Equivalent: Format(Round(IIf([tblCurrencyExchange].[CurrencyID]=1,"",[tblFXRates]![Amount]*[tblCurrencyExchange]![ExchangeRate]), 0),"$#,##0")
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 39698614
For the #Error record what are the contents in the following fields ...

[CurrencyID]
[Amount]
[ExchangeRate]


ET
0
 

Author Comment

by:pdvsa
ID: 39698748
Let me know if you see something....screen print below showing those columns

#error
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:pdvsa
ID: 39698751
it is the only row with a currencyID = 1
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 39698836
Ok, the USD Eauivalent calculated formula will return "" for the value which cannot be formatted to currency ... Try this instead.

USD Equivalent: Format(Round(IIf([tblCurrencyExchange].[CurrencyID]=1,0,Nz([tblFXRates]![Amount], 0)*Nz([tblCurrencyExchange]![ExchangeRate], 0), 0),"$#,##0")

ET
0
 

Author Comment

by:pdvsa
ID: 39699427
ahh I see.  

It gives me a wrong number of args.  I have played around with parenth but couldnt figure it out.   It hightlights the 2nd parent.

]![ExchangeRate], 0), 0),"$#,##0")
                                              ^
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 39699583
Yes, you are missing a closing parenth ... Try this one ...

USD Equivalent: Format(Round(IIf([tblCurrencyExchange].[CurrencyID]=1,0,Nz([tblFXRates]![Amount],0)*Nz([tblCurrencyExchange]![ExchangeRate],0)),0),"$#,##0")


ET
0
 

Author Comment

by:pdvsa
ID: 39703638
thanks for the help.  That worked perfectly.  

have a good one....
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 39703805
Ok, glad to help and thanks for the points.  

ET
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now