Results 1 to 5 of 5
  1. #1
    goomba79 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3

    Update with replace query help

    Hello,



    I have a load of hyperlinks in a table that point to documents on our server.

    we have 2 domains at work so i need to ammend the prefix of the hyperlinks from...
    \\server
    to
    \\server.srl.local

    I have written the following update query..

    Code:
    Update "Document Table"
    Set PathInformation = replace(pathinformation, "SERVER" , "SERVER.srl.local"
    Where PathInformation Like "%SERVER";

    when I run the query i get the following error..

    syntax error in query. Incomplete query clause

    I can't see where I am going wrong, all the examples i can find on google show update/replace queries as i have written mine!

    If anyone can point me in the right direction I will greatly appreciate it!!

    Thanks in advance,

    Iain

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Update "Document Table"
    Set PathInformation = replace(pathinformation, "SERVER" , "SERVER.srl.local")
    Where PathInformation Like "%SERVER";

    Missing a closing )

  3. #3
    goomba79 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3
    Quote Originally Posted by orange View Post
    Update "Document Table"
    Set PathInformation = replace(pathinformation, "SERVER" , "SERVER.srl.local")
    Where PathInformation Like "%SERVER";

    Missing a closing )
    Hello!
    thanks for replying!!
    i have put the closing bracket in but still get a syntax error?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Try this

    Update [Document Table]
    Set PathInformation = replace(pathinformation, "SERVER" , "SERVER.srl.local")
    Where PathInformation Like "%SERVER";


    You should not use spaces or special characters in field and object names.

  5. #5
    goomba79 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3
    Quote Originally Posted by orange View Post
    Try this

    Update [Document Table]
    Set PathInformation = replace(pathinformation, "SERVER" , "SERVER.srl.local")
    Where PathInformation Like "%SERVER";


    You should not use spaces or special characters in field and object names.
    Yeah that's got it going!
    i know about it being bad practice to have spaces in table/field names but unfortunately I inherited the database along with all the mistakes made!

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

Similar Threads

  1. Replies: 6
    Last Post: 07-25-2012, 06:42 AM
  2. Replies: 3
    Last Post: 06-07-2012, 07:05 AM
  3. Replace hash (#) with query
    By JKaranka in forum Queries
    Replies: 3
    Last Post: 06-13-2011, 07:11 AM
  4. Find and Replace query from a 2nd table
    By elightbox in forum Queries
    Replies: 1
    Last Post: 09-17-2010, 05:37 PM
  5. Find and Replace Query
    By randolphoralph in forum Queries
    Replies: 4
    Last Post: 03-17-2010, 07:25 AM

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