Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Trimming off special characters

Discussion in 'Information Technology' started by CMcGrann, Jul 28, 2006.

  1. CMcGrann

    CMcGrann
    Expand Collapse
    Guest

    I have a field with special characters before and after the info I want
    returned. For example:
    [["010XQ12345"
    ["010XQ987654"
    I only want what is between the quotes and remove all other characters. Can
    I do an update query to do this???

    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    Can someone answer my question? (Trimming Beard) New to Sikhism Oct 15, 2012
    Sikh News Players thrown out of meet for trimming hair Breaking News Nov 24, 2004
    Getting Something Off Your Chest Always Makes You Feel Better Hard Talk May 15, 2016
    Sikh News Judge Says Army Can’t Require Special Testing Of Sikh Officer Breaking News Mar 5, 2016
    Cholesterol Is Finally Officially Removed From "naughty List" Health & Nutrition Feb 11, 2016

  3. Al Camp

    Al Camp
    Expand Collapse
    Guest

    If you're saying that every string has a (") just before the text you want, and a (")
    just after the text you want.
    Run an update query against that field (ex. name = [MyStr])...
    =Mid([MyStr],InStr([MyStr],Chr(34))+1,Len([MyStr])-InStr([MyStr],Chr(34))-1)

    I tested against [["1234ABCD" and ["1234ABCD" and [[[["1234ABCD"

    --
    hth
    Al Camp
    Candia Computer Consulting - Candia NH
    http://home.comcast.net/~cccsolutions


    "CMcGrann" <CMcGrann@discussions.microsoft.com> wrote in message
    news:B17A6CB5-355C-4EBD-88D3-6824ECB343B1@microsoft.com...
    >I have a field with special characters before and after the info I want
    > returned. For example:
    > [["010XQ12345"
    > ["010XQ987654"
    > I only want what is between the quotes and remove all other characters. Can
    > I do an update query to do this???
    >
    > Thanks!
     
  4. fredg

    fredg
    Expand Collapse
    Guest

    On Mon, 12 Jun 2006 06:55:01 -0700, CMcGrann wrote:

    > I have a field with special characters before and after the info I want
    > returned. For example:
    > [["010XQ12345"
    > ["010XQ987654"
    > I only want what is between the quotes and remove all other characters. Can
    > I do an update query to do this???
    >
    > Thanks!


    If your data can look like this..
    [["010XQ12345"avbd
    and you want
    010XQ12345

    and you have Access 2000 or newer, then copy and paste the following
    code into a module:

    Public Function RemoveExcessChr(FieldIn As String) As String

    Dim intX As Integer
    Dim strString As String
    strString = Mid(FieldIn, InStr(FieldIn, Chr(34)) + 1)
    strString = Left(strString, InStrRev(strString, Chr(34)) - 1)
    RemoveExcessChr = strString

    End Function

    Next, create an Update query:
    Update YourTable Set YourTable.FieldName =
    RemoveExcessChr([FieldName]) Where YourTable.FieldName is not null;
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     

Share This Page