Access Expression / Pull Out Number and currency (1 Viewer)

smoothlarryhughes

New member
Local time
Today, 15:59
Joined
Jan 28, 2020
Messages
2
Can anyone help me with an expression (preferably with built in functions) to pull the currency and dollar amounts out of the reference field? Examples below:

ReferenceMONEYCURRENCY
/ACOM/43958,90EUR0,0043958.90EUR
/ACOM/48761,41USD0,0048761.41USD
/ACOM/1212,96USD0,001212.96USD
/ACOM/702,89USD0,00702.89USD
/ACOM/222,50USD0,00222.50USD
/ACOM/6196,43EUR0,006196.43EUR
/ACOM/208,16EUR0,00208.16EUR
/ACOM/7006,67EUR0,007006.67EUR
 

June7

AWF VIP
Local time
Today, 11:59
Joined
Mar 9, 2014
Messages
5,466
Assuming currency is always 3 characters:

Cur: Right(Left(x, InStrRev(x,",")-2),3)

Assuming string always begins with "/ACOM/" and Access will recognize the comma in place of period as decimal which it should if you are running a non-U.S. version of Access:

Amt: Val(Mid(x,7))

However, since you show period in result I must presume you are not. So this gets tricky.

Amt: Val(Replace(Mid(x,7), ",", "."))
 
Last edited:

Micron

AWF VIP
Local time
Today, 15:59
Joined
Oct 20, 2018
Messages
3,478
Val will not deal with comma separators or currency signs (not that there are any here)
I was thinking
Replace(Mid("/ACOM/7006,67EUR0,00",Instr(1,"/ACOM/7006,67EUR0,00",",")-1),",00","")

I'm probably not understanding exactly which is the currency part as 7006,67 looks odd to me as a currency value. Some expected results would have helped.
 

June7

AWF VIP
Local time
Today, 11:59
Joined
Mar 9, 2014
Messages
5,466
Expected results are showing in OP. I revised my answer. Tested and works.
 

Users who are viewing this thread

Top Bottom