String functions

message from =?Utf-8?B?R3Jhc3NmaW5jaA==?= on 21 May 2004
Can anybody help me with a little problem i'm having with string functions please?
I'm writing a query with which i want to create an expression to get part of a string. The string is a British postcode in the format AA0_0AA or AA00_0AA (where _ is a space). I want to be able to get the characters to the left of the space in both formats without getting the space and by only writing on eexpression that applies to both. Any help would be much appreciated.
Thanks
 
Van T. Dinh replied to =?Utf-8?B?R3Jhc3NmaW5jaA==?= on 22 May 2004
Left([InputString], InStr([InputString], "_") - 1)

where the underscore is a space character.
 

Archived message: String functions (MS Access Forms)