UK Postcodes - return only the first part
SummaryTrying to remove everything after a space in a report
We have a field (let's say "incidents.c$postcode") containing UK postcodes. This is a text field.
For those unaware, the format of UK postcodes can vary, though the commonalities are:
- The postcode is in two parts, separated by a space
- The second part is always "Number,Letter,Letter"
The first part always begins with a letter, but it [the first part] could be:
- Letter | Number
- Letter | Number | Number
- Letter | Letter | Number
- Letter | Letter | Number | Number
- Letter | Letter | Number | Letter (this format is rare)
- N1 1AA
- L12 1AA