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

Some sort of "Find and replace"

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

  1. Adidre1

    Adidre1
    Expand Collapse
    Guest

    Hello,

    I need to update a text field in a table which contains strings of variable
    lenght separated by % character: AAAAA%BBBBB%CCCC.
    How can I create a query or a function to keep in that field just the BBBBB
    string?
    In Excel I used find and replace:
    - find A*% and replace with NULL
    - find %C* and replace with NULL and I have just BBBBB string
    How can I do the same thing in Access?

    THX
     
  2. Loading...

    Similar Threads Forum Date
    I Am Sort Of New To Sikhism New to Sikhism May 3, 2013
    Consortium agrees to pay 11.3 billion dollars for SunGard Data Systems (AFP) Interfaith Dialogues Mar 28, 2005
    Difficulty Finding Raag Gurmat Sangeet Tanti Saaj Nitnem Audio And Video Gurmat Sangeet Jan 13, 2017
    Pathfinder Joins Sikh Philosophy Network! New SPN'ers Sep 5, 2016
    The Salmon Story, Finding Home Sikh Sikhi Sikhism Jul 29, 2016

  3. Jon Lewis

    Jon Lewis
    Expand Collapse
    Guest

    Have a look at the InStr, Left, Mid, Right functions.


    "Adidre1" <Adidre1@discussions.microsoft.com> wrote in message
    news:CE4E196F-4D59-45AB-9A75-2E9B69FDBCEA@microsoft.com...
    > Hello,
    >
    > I need to update a text field in a table which contains strings of
    > variable
    > lenght separated by % character: AAAAA%BBBBB%CCCC.
    > How can I create a query or a function to keep in that field just the
    > BBBBB
    > string?
    > In Excel I used find and replace:
    > - find A*% and replace with NULL
    > - find %C* and replace with NULL and I have just BBBBB string
    > How can I do the same thing in Access?
    >
    > THX
     
  4. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Is it always going to be 3 strings separated by % and you always want the
    2nd string?

    You can use the Split function:

    Split(MyString, "%")(1)

    will give you the 2nd string (it starts counting at 0)

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Adidre1" <Adidre1@discussions.microsoft.com> wrote in message
    news:CE4E196F-4D59-45AB-9A75-2E9B69FDBCEA@microsoft.com...
    > Hello,
    >
    > I need to update a text field in a table which contains strings of

    variable
    > lenght separated by % character: AAAAA%BBBBB%CCCC.
    > How can I create a query or a function to keep in that field just the

    BBBBB
    > string?
    > In Excel I used find and replace:
    > - find A*% and replace with NULL
    > - find %C* and replace with NULL and I have just BBBBB string
    > How can I do the same thing in Access?
    >
    > THX
     
  5. Adidre1

    Adidre1
    Expand Collapse
    Guest

    Sometimes the first and the last string are missing...
    And I have to work with Access 97

    Thanks

    "Douglas J Steele" wrote:

    > Is it always going to be 3 strings separated by % and you always want the
    > 2nd string?
    >
    > You can use the Split function:
    >
    > Split(MyString, "%")(1)
    >
    > will give you the 2nd string (it starts counting at 0)
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Adidre1" <Adidre1@discussions.microsoft.com> wrote in message
    > news:CE4E196F-4D59-45AB-9A75-2E9B69FDBCEA@microsoft.com...
    > > Hello,
    > >
    > > I need to update a text field in a table which contains strings of

    > variable
    > > lenght separated by % character: AAAAA%BBBBB%CCCC.
    > > How can I create a query or a function to keep in that field just the

    > BBBBB
    > > string?
    > > In Excel I used find and replace:
    > > - find A*% and replace with NULL
    > > - find %C* and replace with NULL and I have just BBBBB string
    > > How can I do the same thing in Access?
    > >
    > > THX

    >
    >
    >
     
  6. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Well, it's possible to write a Split function for Access 97, but if you
    don't know the number of substrings in advance, you're probably better off
    using the InStr and Mid like Jon suggested.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Adidre1" <Adidre1@discussions.microsoft.com> wrote in message
    news:3BAC1917-4C10-4A61-B99E-8F75171A6D6B@microsoft.com...
    > Sometimes the first and the last string are missing...
    > And I have to work with Access 97
    >
    > Thanks
    >
    > "Douglas J Steele" wrote:
    >
    > > Is it always going to be 3 strings separated by % and you always want

    the
    > > 2nd string?
    > >
    > > You can use the Split function:
    > >
    > > Split(MyString, "%")(1)
    > >
    > > will give you the 2nd string (it starts counting at 0)
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Adidre1" <Adidre1@discussions.microsoft.com> wrote in message
    > > news:CE4E196F-4D59-45AB-9A75-2E9B69FDBCEA@microsoft.com...
    > > > Hello,
    > > >
    > > > I need to update a text field in a table which contains strings of

    > > variable
    > > > lenght separated by % character: AAAAA%BBBBB%CCCC.
    > > > How can I create a query or a function to keep in that field just the

    > > BBBBB
    > > > string?
    > > > In Excel I used find and replace:
    > > > - find A*% and replace with NULL
    > > > - find %C* and replace with NULL and I have just BBBBB string
    > > > How can I do the same thing in Access?
    > > >
    > > > THX

    > >
    > >
    > >
     
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