iif statement in access query design view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buddyr
    New Member
    • Apr 2007
    • 105

    iif statement in access query design view

    example:
    field1 bblandscape, wallmart, kmart
    field2 4,6,9
    field3 5,7,6
    field4 12,0,5
    field5

    if field2 > field3 then field5 = "Yes"
    if field4 = 0 then field5 = "Yes"

    can I add an if (iif) statement or switch statement to field5 in design view of a query and perform both these conditional statements together in some way. I am not writing the syntax right.
    thank you
  • whitbacon
    New Member
    • Apr 2008
    • 8

    #2
    Try

    field5: iif(field4 = 0, "Yes", iif(field2 > field3, "Yes", "No")

    Comment

    • buddyr
      New Member
      • Apr 2007
      • 105

      #3
      Thank you
      It worked - I used to use alot of conditional statements in vb6 - but I struggle with the different syntax in access

      Comment

      Working...