Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    Posts
    3

    Unanswered: extract substrings from a field

    Using VBScript or SQL queries, I need to populate a combo-box with substrings (characters 1, or 1 & 2, or 1, 2 & 3) extracted from members of a string field in an Access table. Can anyone help?

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    You can use Left(), Right(), Mid() VBA functions to manipulate substrings.
    Example:

    ? Left("123456789",2)
    12

  3. #3
    Join Date
    Feb 2002
    Posts
    3
    Originally posted by IGelin
    You can use Left(), Right(), Mid() VBA functions to manipulate substrings.
    Example:

    ? Left("123456789",2)
    12
    Thanks IGelin - I need to use these functions in an SQL statement but it seems that the only option in SQL is LTRIM which is not suitable. Ideally, I would like to be able to write the following:
    SELECT left([column],3) FROM [TABLE]. Thanks in advance, Andy

  4. #4
    Join Date
    Nov 2001
    Posts
    336
    SELECT left([column],3) as NewName FROM [TABLE];

Posting Permissions

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