Solved

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

Posted on 2012-12-23
12
723 Views
Last Modified: 2012-12-24
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"
0
Comment
Question by:bill201
  • 4
  • 2
  • 2
  • +3
12 Comments
 
LVL 26

Assisted Solution

by:jerryb30
jerryb30 earned 63 total points
ID: 38717525
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
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38717527
Can you not....
0
 

Author Comment

by:bill201
ID: 38717561
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")
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 5

Assisted Solution

by:vguzman
vguzman earned 62 total points
ID: 38717749
Can you just concatenate the symbol and your price ? like:
"Shekel Symbol" & " " & [total]
0
 

Author Comment

by:bill201
ID: 38718412
but i want that it's will be a number value and not a text string
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 62 total points
ID: 38718534
If you concatenate a char and a number you will get a string.
If you also need the numerice value, have two columns.

/gustav
0
 

Author Comment

by:bill201
ID: 38718541
its not possible that the char will just be a format visualy?
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 63 total points
ID: 38718557
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
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 38718559
Yes, then you would use the Format property:

\€#,##0.00

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

/gustav
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38718561
That was supposed to be a shekel symbol, but it would not post.  The sample file uses the symbol correctly.
0
 
LVL 1

Accepted Solution

by:
jyk_aus earned 250 total points
ID: 38719381
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
0
 

Author Closing Comment

by:bill201
ID: 38719517
thanks alot  for every one
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

831 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