Results 1 to 9 of 9
  1. #1
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52

    Update Query


    We have a database with limited access for updating (no find and replace available). As of now, I have 3 customers requiring their email address to be updated. I am using
    Code:
     Expr1: Left([Contact.Email_Address],Len([Contact.Email_Address])-13) & "somewhere.com"
    . But of course I have to count the number of characters for the domain on each use (room for error). I was trying to search to the @ with no luck. Any assist would be greatly appreciated.

  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,850
    Do you know the Customer numbers?
    Write a SELECT query to show all the Customer info for those Customers.
    Back up your table.
    Identify the existing email addresses.

    Are you going to do this using UPDATE queries? Or are you going to modify the values in the table?

    You are talking about 3 records -- what exactly is the difficulty?
    Last edited by orange; 04-03-2013 at 03:19 PM. Reason: spelling

  3. #3
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    I have limited access to the DB. Updated records can only be done through using the update query. Regarding records, there are 3 customers that I have to update, totaling over 250 contacts. This DB is restricted. I can not alter records directly.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Did you try:

    Left([fieldname], InStr([fieldname],"@")) & "somewhere.com"

    and don't forget the WHERE clause in the UPDATE action
    Last edited by June7; 04-04-2013 at 10:57 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    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,850
    Please show us a jpg of your tables and relationships, or tell us clearly how Customers and Contacts are related.

    I'm not following this

    I have 3 customers requiring their email address to be updated
    and
    Regarding records, there are 3 customers that I have to update, totaling over 250 contacts.

  6. #6
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    All set. Thank you. The quotes around fieldname was the issue. I had them around the second, and yet it works with no "".

  7. #7
    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,850
    Just a caution:

    Update queries can be very unforgiving. Backup your data.
    Test your criteria by using a SELECT query to make sure you are dealing with the correct records and fields.

  8. #8
    dweekley is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    52
    Thanks you for the advise. I do run a select first, then create my update query. Also check record count between the 2. To much risk just jumping in. Thanks again.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Sorry, I shouldn't have put quotes around [fieldname]. Typing error. Fixed post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  2. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  3. Replies: 1
    Last Post: 08-19-2011, 12:16 PM
  4. Update 2 tables with one Update Query
    By Douglasrac in forum Queries
    Replies: 4
    Last Post: 04-14-2011, 08:33 AM
  5. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 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