Results 1 to 3 of 3

Thread: Text functions

  1. #1
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Unanswered: Text functions

    I would like write in a query a formula that can extract some text from a record table. The example is this one:

    [Record 1] Abcdefg - psdifd - xpto [I want extract "Abcdefg"]
    [Record 2] Nhdsusndbfnfhfdfxc - asjd - xpto [I want extract "Nhds....."]
    [Record 3] Ksd - dsuhdgfgdgsga - xpto [ I want extract "Ksd" ]

    I can extract the last part of the record with right$ [xpto as a fixed len], so it's simple.

    But to extract the first part (in the first example is "Abcdefg") I don't know how. This first part has no fixed lenght.

    Can someboby give me an idea?

    A great thank you!

    Ruas

  2. #2
    Join Date
    Oct 2003
    Posts
    66
    Try using the len function which will give you the length of a string. You can use this first to determine the length and then use the left$ funtion to extract your sectio you want.

  3. #3
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    Yes, of course. Thank you.

    This is the working formula:

    Left$([name];len([name])-4)

    [-4 is the len of xpto]

    Thank you again...

    Ruas

Posting Permissions

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