Results 1 to 3 of 3
  1. #1
    Techno is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2023
    Posts
    31

    If then else logic in expression builder for calculated column

    I need to add a calculated column at the end of a select query that runs on table1(which is linked table) by expression builder, the logic is-
    Calculated Column Value = If (table1.columnname(x) = "abc") then 1 else (table1.columnname(y).value)
    How to do it? Any help greatly appreciated.

    As a workaround to the above I tried to run an update query on linked table and it rightly failed.

  2. #2
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    233
    You need to use the IIF function.
    Code:
    IIF(X = "abc", 1, Y)
    Groeten,

    Peter

  3. #3
    Techno is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2023
    Posts
    31
    Thank you...

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

Similar Threads

  1. Replies: 11
    Last Post: 06-16-2022, 08:45 AM
  2. Calculated field using Expression Builder
    By Pyeman in forum Access
    Replies: 2
    Last Post: 10-25-2021, 12:14 PM
  3. Replies: 3
    Last Post: 05-17-2020, 09:23 AM
  4. Replies: 12
    Last Post: 07-06-2017, 11:43 AM
  5. Replies: 1
    Last Post: 05-09-2013, 07:54 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