Results 1 to 8 of 8
  1. #1
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89

    Mid Question perhaps?

    Greetings, I am having difficulties with this: I have a column with students and teacher combined 14(25)2(represents 14 students, 25 class seats and 2 teachers, I am tring to pull the 25 seats out into a seperate column on my querry. any ides?



    V/R
    novice

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Presuming the number of characters can vary, you can use the Mid() function along with the InStr() and InStrRev() functions to find the opening and closing parentheses.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Heh.. pbaldy... I know John Galt

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why is this data combined into one field anyway? Store in separate fields. Concatenation is easier than splitting.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89
    Quote Originally Posted by pbaldy View Post
    Presuming the number of characters can vary, you can use the Mid() function along with the InStr() and InStrRev() functions to find the opening and closing parentheses.


    can you give me an example please

  6. #6
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89
    Quote Originally Posted by June7 View Post
    Why is this data combined into one field anyway? Store in separate fields. Concatenation is easier than splitting.
    Agreed, But I do not produce the original RAW Data....

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Val(Mid(x, InStr(x, "(") + 1))

    Use field name in place of x.

    Access Help (or search web) has more info on string manipulation functions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89
    that worked thanks I appreciate it

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-25-2012, 07:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums