Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

FormatCurrency()

This function is listed with the other Format(), but when I try to use the FormatCurrency in a Query, or Report I get only errors, as though it does not recognize this Function. Is this documented  somewhere? What's up with the FormatCurrency?
0
eeevbeee
Asked:
eeevbeee
1 Solution
 
nico5038Commented:
Just type the command under VBA and press F1 for the syntax.

The query indeed doesn't accept the function. (Guess M$ made a mistake)

I used a workaroud by creating a function in the modules section like:

Function fncFormatcurrency(strCurr As Currency)

fncFormatcurrency = FormatCurrency(strCurr, 2)

End Function

And the query:

SELECT fncFormatcurrency([UnitPrice]) AS Pr
FROM Products;

What will supply the wanted format.....

Nic;o)
0
 
Ryan ChongCommented:
or you can directly using Format like this to show Currency in Format you want:

SELECT Format([UnitPrice],"##,##0.00") AS Pr
FROM Products;
0
 
samphiCommented:
You can use CCur...

"Where salary = ccur(""" & Format$(MyCurrencyValue) & """)"

That use the "regional setting"

Good Luck!
Phil.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now