Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002

    Unanswered: multiple updates to update a field in a table

    Hi...I have a field expiration date in my table and the UPDATE query criteria differs for months 1-11 and the month 12 can I run these 2 update queries for each of these criteria together in a single UPDATE query to update this expiration date field at one go...I tried using UNION to join these 2 UPDATE queries into one UPDATE query..can anyine help me please...

    Its like
    UPDATE Member SET Member.ExpirationDate = (PaymentMonth+1) & "/1/ " & DatePart("yyyy",Date())+1
    WHERE PaymentMonth<12
    UPDATE Member SET Member.ExpirationDate = "1/1/" & DatePart("yyyy",Date())+2
    WHERE PaymentMonth=12;

    I hope this will help you understand my question better


  2. #2
    Join Date
    Sep 2001
    Chicago, Illinois, USA
    How about:

    UPDATE Member SET Member.ExpirationDate = IIF(PaymentMonth=12,"1/1/" & DatePart("yyyy",Date())+2,(PaymentMonth+1) & "/1/ " & DatePart("yyyy",Date())+1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts