Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    London
    Posts
    76

    Unanswered: extracting text before a space

    Hi,

    I need to extract the first characters of a post code for a set of records i.e.
    N1 6LA
    SW12 4RA

    to show in a combo box as N1, SW12 etc

    What function can i use to get these results?

  2. #2
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108

    Re: extracting text before a space

    Typing this as an expression in a query returns the character number of a space:

    FindSpace: InStr([your field]," ")

    Once you have the location of the space you can use the MID function to do the rest:

    To return the first part of the post code:
    mid([your field],0,[FindSpace]-1)

    To return the latter part:
    mid([your field],[FindSpace],len([your field])


    Regards - Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •