Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page