Gathered data within dash or 2 dotfrom the table field

Boris2012

New member
Local time
Today, 07:19
Joined
May 13, 2014
Messages
1
Dear Sir/Madame,
I have an issue gather a certain data from the diffrent size of long text from table 2 different field from the query..
Text as like that First field on table ' RS - SERBIA : BEG - Belgrade'
'ME - MONTENEGRO : TGD - Podgorica'

I would like to have the data only 3 digit lenght code 'BEG' with the query result must show.
I would like to have query result shows only Code
BEG
TGD

Do you have any idea how to use if function together with mid or any other ideas very welcome..
Thanks alot..
 
Hello,
You use the Instr function and combine the result with MID.
There below a code with the details where you can delete fields that you want with field SIGLE as result :

Code:
SELECT YourTable.YourField, InStr([YourField],":") AS StartPos, Mid([YourField],[StartPos]+1,4) AS SIGLE
FROM YourTable;

Good continuation
 

Users who are viewing this thread

Back
Top Bottom