Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking to trim a field storing postcodes, the issue im having is that i dont want to specify the trim to a set number of characters as some first parts of a post code can be 2,3 or 4 characters long.
Is it possilbe to trim until it reaches a space, so for example
B1 2AA = B1
B12 3AA = B12
BE12 4BB = BE12
Any help would be greatly apreciated...
Hi,
Probably the easiest way to get it is
SubField(Postcode, ' ', 1) AS FirstPart,
SubField(Postcode, ' ', 2) AS SecondPart
Hope that helps.
Miguel
Maybe
LOAD
...
subfield(POSTCODEFIELD, ' ',1) as TrimmedPostcodes,
...
Hi,
Probably the easiest way to get it is
SubField(Postcode, ' ', 1) AS FirstPart,
SubField(Postcode, ' ', 2) AS SecondPart
Hope that helps.
Miguel
try this
trim(left(str,index(str,' ')))
Perfect guys, thanks very much for your help!