Results 1 to 4 of 4
  1. #1
    matt1000 is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    3

    How Can I set one field to "Complete," when another field is Older than 6 months?

    Hello All,

    I am attempting to update a "Completed" status field to "Complete" if an "Original_Sub" field is 6 months older than the sys date. Any ideas on how this can be done with sql?



    Thanks in advance for anyones help!

    Regards,

    Matt r.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How about

    UPDATE TableName
    SET FieldName = "Complete"
    WHERE DateFieldName < DateAdd("m", -6, Date())
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    matt1000 is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    3

    Talking Awesome Fix

    pbaldy,

    Thanks a ton!! It worked fantastically. I only mad a few changes. Here they are below:


    UPDATE tblAnalysis_file SET tblAnalysis_file.completed = "Complete", tblAnalysis_file.chart = "Disregard", tblAnalysis_file.status = "Submission Date > 6 Months", tblAnalysis_file.comments = "Failed Submission not Reactivated"
    WHERE (((tblAnalysis_file.[original_sub])<=DateAdd("d",-180,Date())) AND ((tblAnalysis_file.[completed])<>"Complete"));


    Thanks again!!!!

    Regards,

    Matt r.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Matt, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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. Combined "person" field on form
    By Remster in forum Forms
    Replies: 14
    Last Post: 09-15-2010, 10:44 AM
  3. Replies: 12
    Last Post: 06-14-2010, 08:39 PM
  4. replace a empty field with the word "none" how??
    By techexpressinc in forum Queries
    Replies: 1
    Last Post: 01-15-2010, 11:02 AM
  5. Error message and How do I find the "value Field" ?
    By createdwithfire in forum Forms
    Replies: 1
    Last Post: 11-05-2009, 12:26 PM

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