Query part of a text field

Raaff

New member
Local time
Today, 22:43
Joined
Jun 11, 2012
Messages
3
I need to query a text field where the last 1 or 6 positions of the field always consists of a number. I want to be able to query that number. Now normally I would expect a seperate field in the table for that number. Alas, the manufacturer of the program has decided to store it in this way:

"some odd text <space>123456"

Now I am building a custum report not available in the program. Any ideas as to how I could query the number?
 
You should be able to do it with something along the lines of;
Code:
[URL="http://www.techonthenet.com/access/functions/string/right.php"]Right[/URL]("YourTextHere", [URL="http://www.techonthenet.com/access/functions/string/len.php"]Len[/URL]("YourTextHere" - [URL="http://www.techonthenet.com/access/functions/string/instrrev.php"]InStrRev[/URL]("YourTextHere", " ")))
 
Or:
Code:
mid("YourTextHere", instrrev("YourTextHere", " ") + 1)
 

Users who are viewing this thread

Back
Top Bottom