Forum Discussion

deefunk1981's avatar
deefunk1981
Frequent Visitor
4 years ago
Solved

Extract first 4 digits from postcode from text column

Hi,   I have a column which has full addresses in it which due to the various ways the addresses have been handed over from the client I can't use the extract by delimiter function.  I would like t...
  • amitchandak's avatar
    4 years ago

    deefunk1981 , One way is to search position of BT and then take 4 character

     

    mid([column], search("BT",[Column],,len([Column])), 4)

  • truptis's avatar
    4 years ago

    deefunk1981 ,

    Steps to follow:
    1- Create a new column (by right clicking on a table and selecting new column option) and use the calculation given by amitchandak 

    new_Column = mid([column1], search(" BT",[Column1],,len([Column1])), 4)

    this will give you a new column with the first 4 digits of your postcode.

     

    search(" BT"...) is going to search in your text if " BT" is there. If it is there then it will take first 4 characters(for which we have used ",4" in the formula) from BT to the right including BT.