Solved Remove text Prefix from a number

Number11

Member
Local time
Today, 20:29
Joined
Jan 29, 2020
Messages
619
Hi

So i need to remove the prefixed number from "ACC/0014471211" to "0014471211"

whats the best way to do this with a query?
 
Code:
Mid(XExpression, 5)
'------
RegExReplace(XExpression, ".*(\d+)", "$1")
 
That depends on whether the prefix is always the same number of positions long. And if that is not the case, then it always ends with a /?
 
Eberhards solution (MID) will do.
 
ok thanks got it working now using

AccountRef: Mid([Account_No],5)
 
Hi

So i need to remove the prefixed number from "ACC/0014471211" to "0014471211"

whats the best way to do this with a query?

I take it you realise that your "number" is a text string, not a number. You may have to be careful that "0014471211" doesn't get treated as just 14471211 in some cases.

Also that the value doesn't exceed the max value of a longint (approx 2 billion) which might produce a different type of error.
 

Users who are viewing this thread

Back
Top Bottom