how to format a value in a query in access to a different curreny symbol

bill201
bill201 used Ask the Experts™
on
i want to get in a access query a currency value with another currency symbol and not the windows default. is that possible?

this is my code: Format(total,"Currency") AS TotalEx

if is not possible is there some way to add a word to a num value (visualy) like 100 with the word "euro"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Cab you not format the field as currency/euro in table design?
Otherwise, look here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_21695968.html

Commented:
Can you not....

Author

Commented:
thanks alot for your answer

i will be more specific i dont need a euro symbol (it's was an example) i need a Shekel symbol
like there http://en.wikipedia.org/wiki/Shekel_sign
where can i put this
format ([price],"shekel Symbol")
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

vguzmanPresident
Commented:
Can you just concatenate the symbol and your price ? like:
"Shekel Symbol" & " " & [total]

Author

Commented:
but i want that it's will be a number value and not a text string
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
If you concatenate a char and a number you will get a string.
If you also need the numerice value, have two columns.

/gustav

Author

Commented:
its not possible that the char will just be a format visualy?
Top Expert 2010
Commented:
In your table design, select that column, and in Format for the column properties use something like this:

¿#,##0.00;(¿#,##0.00)

It worked for me.

Q-27976657.mdb
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Yes, then you would use the Format property:

\€#,##0.00

Replace € with your Sekel sign (the font here seems not to hold it).

/gustav
Top Expert 2010

Commented:
That was supposed to be a shekel symbol, but it would not post.  The sample file uses the symbol correctly.
Commented:
I use multiple currencies, including the shekel  regularly.

The way I approach this particularly problem is by having a 'Currencies' table that holds the currencies signs amongst other thing - the *minimum* you would need is:

[Currency_ID]  = PK
[Currency Name]
[Currency ISO] (eg USD, ILS, EUR etc), Required, zero length not allowed
[Currency Symbol]  - not required as some currencies don't have a specific symbol or I dont have symbols for such currencies.

All these fields are Indexed, duplications not allowed - you may allow duplication in the symbol but I would not recommend it.

If you are using more than one currency that uses the dollar sign and you allow duplications it is still  a good practice to distinguish beteen them by using US$, A$, C$, NZ$ etc  as symbol, the same gors for the franc sign, if you are using it.

I  have a public function, say CurrencySymbol(), that extrct the symbol using the  DLookup() and if it returns Null for the symbol it uses the [Currency ISO] as an alternative, e.g.

++++++++
Public Function CurrencySymbol( _
idCurrency As Long) _
As String

    Dim tmpSymbol As Variant, tmpCode As String
   
    tmpSymbol = DLookup("[Currency Symbol]", "Currencies", "[Currency_ID]=" _
    & idCurrency)
    tmpCode = Nz(DLookup("[ISO Code]", "Currencies", "[Currency_ID]=" _
    & idCurrency), "")
   
    CurrencySymbol = IIf(IsNull(tmpSymbol) Or Len(CStr(tmpSymbol)) = 0, tmpCode, _
    CStr(tmpSymbol))
   
   
End Function
+++++++++

In order to display the currency symbol in a query, I link the query to the currency table on [Currency_ID] and the rest is simple:

YourField=CurrencySymbol([Curreny_ID]) & Format(YourAmount,"#,##0.00")

Note: This assumes that *all* the currencies that you are using are sub-divisible by 100 (e.g 100 cents in a dollar, 100 agorot in a Skekel etc), if this is not the case, such as in Yen  and some other currencies, the query is slightly more compleicated  if you wish to eliminate the decimal for such currencies.

I hope that this is helpful

Best regards
Jacob

Author

Commented:
thanks alot  for every one

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial