Results 1 to 4 of 4
  1. #1
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286

    HELP with UPDATE Query

    Hello, i have an update query that looks at a master table and grabs the values in the "last read date" column and updates it to another table (lets call it table 2) with the same column.



    If the last readdate is greater than the due date then print a "0", if not, then do the calculation of date()-due date.

    This works great, but it updates every row in table 2. I want it so that if the row already contains a "0", then dont update the last read date for that row. How would i get it to do this? thanks

    This is my code:

    IIf([LastReadDate]>=[due date],"0",Date()-[Due Date])

  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,743
    Take a look here
    http://www.w3schools.com/sql/sql_update.asp

    especially the Warning statement

  3. #3
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286
    ahh i see, so if i put "not like "0"" in the criteria, it should maintain that logic then correct?

  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,743
    Please show the full sql of your query.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  2. Replies: 2
    Last Post: 09-21-2011, 01:30 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