Results 1 to 5 of 5
  1. #1
    FoolzRailer is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    51

    Update column in query based on value in the same query?

    Hello

    I'm trying to fill the column Saneres/Vurderes.



    Basically what I need it to do, is that if any of the black marked ones are true in TVObsKode, TVObsKlasse, Type1, Type 2 (ex. "AF>=3 until "RŲ">4), it needs to put in a "Saneres" if any of the white ones are true, it should say "Vurderes". I should say, that the column being updated, is created by the query, so it is not an existing table.


    Click image for larger version. 

Name:	access.PNG 
Views:	9 
Size:	75.1 KB 
ID:	28494

    Any help on doing this, or how I should go about it.
    Last edited by FoolzRailer; 05-02-2017 at 06:38 AM. Reason: Updated picture.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What are you trying to accomplish in plain, simple English? We need some business context to understand WHAT before we can offer options for HOW.

  3. #3
    FoolzRailer is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    51
    What is shown in the criteria, is observations in pipes, their severity and types. Based on this, they either must be fixed (saneres), or just evaluated (vurderes).
    So all those criteria marked with black, shows observations which must be fixed, example is RŲ 4 (last black), which are roots in the pipes.

    This way, when I later export it to excel, they can see which group the observations belong to.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Sounds like you need an IIF statement, something like:

    Saneres_Vurderes: IIF([TvOBSKode] = "AF" and [TvOBSKlasse]> 3.5, "Fix", "Evaluate")

    You can look up IIF statements online but basically its IIF([Expression],If True,If False) and you can have multiple inside each other

    Saneres_Vurderes: IIF([TvOBSKode] = "AF" and [TvOBSKlasse]> 3.5, "Fix", IIF([TvOBSKode] = "F5" and [TvOBSKlasse]> 4, "Fix", "Evaluate"), "Evaluate"))

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Check out Update queries. They have an 'Update to' row.
    BTW Saneres/Vurderes is a terrible data name. It could be interpreted by Access as "Santeres divided by Vurderes".

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

Similar Threads

  1. Replies: 5
    Last Post: 09-05-2016, 09:07 AM
  2. Replies: 3
    Last Post: 02-22-2016, 03:38 PM
  3. Replies: 4
    Last Post: 12-29-2015, 03:25 PM
  4. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  5. Replies: 1
    Last Post: 09-05-2010, 11:28 AM

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