Results 1 to 6 of 6
  1. #1
    sfgiantsdude is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    34

    update one field using criteria from multiple fields


    I am designing an update query for a specific field in my table

    There are 3 fields: PROVIDER_GROUP, MEDI_CAL_IND, MEMBER_LOW_CAT

    I want to update the value of "Y" in the MEDI_CAL_IND field to "N" if:

    the medi_cal_ind value is "Y" AND the PROVIDER_GROUP is "Medicare_Part_D"

    OR

    the medi-cal_ind value is "Y" AND the MEMBER_LOW_CAT is "Commercial"

    A screenshot of the table is attached.

    Thanks!
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Is Medi_Cal a text or Yes/No field type

    If Yes/No Try:

    UPDATE Extract Set Medi_cal = False WHERE Medi_cal=True AND (Provider_Group = "Medicare_Part_D" OR Member_Low_Cat="Commercial")
    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.

  3. #3
    sfgiantsdude is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    34
    thanks for responding. It is actually just a text field however. Is the above syntax something i could use in design view or is it vba code?

    thanks!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    You could copy/paste that into SQL View of query designer then view the setup in Design View.

    Change the True and False to "Y" and "N"
    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
    sfgiantsdude is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    34
    Thank you.

    Is there any way to do this without having to change it to a Yes/No field. I am not familiar with this data type. The data source isn't set up to accomodate the Yes/No format I don't believe.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    I did not suggest you change the field type.

    I said change the criteria in the UPDATE sql statement to use "Y" and "N" instead of True and False.
    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. Multiple Fields in Criteria - String
    By alsoto in forum Forms
    Replies: 3
    Last Post: 08-24-2011, 12:23 PM
  3. FindFirst with multiple fields in criteria
    By compooper in forum Programming
    Replies: 5
    Last Post: 07-22-2011, 10:29 AM
  4. Replies: 15
    Last Post: 10-14-2010, 12:22 PM
  5. Replies: 1
    Last Post: 02-03-2010, 09:17 PM

Tags for this Thread

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