Welcome to SPN

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

Sign Up Now!
  1. Guest ji, please consider donating today!   Become a Supporter    ::   Make a Contribution   
    Monthly (Recurring) Target: $300 :: Achieved: $95

Question about using Update query replace function together-Fails in Access 2002

Discussion in 'Information Technology' started by Mike Strout, Nov 2, 2005.

  1. Mike Strout

    Mike Strout
    Expand Collapse
    Guest

    I have a fairly large Sql2k DB in which I am trying to update some addresses
    so the Post Office will deliver our statements. Here is the query I am
    trying to run...

    UPDATE dbo_PATIENT SET dbo_PATIENT.ADDRESS =
    Replace([dbo_PATIENT.ADDRESS],[Enter old string],[Enter new string])
    WHERE (((dbo_PATIENT.ADDRESS) Like "* " & [Enter old string] & " *"));

    What I am trying to accomplish is to replace all instances of a given
    substring in the address field based on the two parameters entered by the
    user. For example, the field may contain...

    1234 CR 47

    I want to query the table and replace all instances of "CR" with "Country
    Road". You may notice that I left spaces between the wildcards and the
    parameters. This is so "987 Creekside Trail" doesn't get changed to "987
    County Roadeekside Trail".

    Hopefully this all makes sense. Now the problem. When I click on the
    Datasheet view in access, I will get a correct match on 1234 CR 47 and it
    will be displayed. However, when I actually try to execute the query, I get
    0 matching rows, even though I enter the parameters exactly the same.

    What is going on?

    Mike
    <><
     
  2. Loading...

    Similar Threads Forum Date
    Anyone Have Any Unanswered Questions On Sikhi Or God? Sikh Sikhi Sikhism Jan 7, 2017
    Question About Translations Questions and Answers Dec 20, 2016
    Question About GGS Questions and Answers Aug 28, 2016
    Marriage And Discrimination Related Questions Blogs Mar 21, 2016
    Sikhi Questioning Faith Sikh Sikhi Sikhism Mar 3, 2016

  3. Dirk Goldgar

    Dirk Goldgar
    Expand Collapse
    Guest

    "Mike Strout" <m i k e s t r o u t @ h o t m a i l . c o m> wrote in
    message news:ePP9f.2496$IB.2356@dukeread11
    > I have a fairly large Sql2k DB in which I am trying to update some
    > addresses so the Post Office will deliver our statements. Here is the
    > query I am trying to run...
    >
    > UPDATE dbo_PATIENT SET dbo_PATIENT.ADDRESS =
    > Replace([dbo_PATIENT.ADDRESS],[Enter old string],[Enter new string])
    > WHERE (((dbo_PATIENT.ADDRESS) Like "* " & [Enter old string] & " *"));
    >
    > What I am trying to accomplish is to replace all instances of a given
    > substring in the address field based on the two parameters entered by
    > the user. For example, the field may contain...
    >
    > 1234 CR 47
    >
    > I want to query the table and replace all instances of "CR" with
    > "Country Road". You may notice that I left spaces between the
    > wildcards and the parameters. This is so "987 Creekside Trail"
    > doesn't get changed to "987 County Roadeekside Trail".
    >
    > Hopefully this all makes sense. Now the problem. When I click on the
    > Datasheet view in access, I will get a correct match on 1234 CR 47
    > and it will be displayed. However, when I actually try to execute the
    > query, I get 0 matching rows, even though I enter the parameters
    > exactly the same.
    >
    > What is going on?
    >
    > Mike
    > <><


    How are you executing the query? Directly from the query design view,
    or using code (and if code, what code)? Is this in an MDB file with
    linked tables (sounds like it), or in ADP?

    --
    Dirk Goldgar, MS Access MVP
    www.datagnostics.com

    (please reply to the newsgroup)
     
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