Any Microsoft ACCESS experts out there? Can part of the data in a field be queried?

edprush

Platinum Member
Sep 18, 2000
2,541
0
0
Any Microsoft ACCESS experts out there? Can part of the data in a field be queried?

I have a cell with the following information entered in it:
STPN-58-7(78)--89-88

Is it possible to have ACCESS read the last two digits in that cell (i.e., 88) and have the alpha equivalent displayed in another cell in the same record?

The '88' stands for a county name. I, obviously, could type the county name in the other cell but if I could automate this it would be great.

If you can assist me or have any other questions please feel free to post them.

Thanks!
 

LordEdmond

Senior member
Feb 12, 2001
410
0
0
The word cell puzzles me makes me think of Excel

if you mean field then it is possible to query part of a field

go to query in the criteria field click (double) go to build, the function your require is in built in functions under text it is called InStr look at the expansion that will explain
 

marcio

Senior member
Feb 23, 2001
323
0
0
The correct function is Right([AssetCode],2)

If by "cell" you mean a table cell, then no, you can't do that. The correct way would be for you to write a lookup table to display/print the country name for the corresponding country code.

Another way to do this would be to create a table CountryCodes for the codes and countries and create an extra field in your original table just for the extra two digits (which would then reference the country table) and decrease the original field by two characters.