IIF Statement NOT working with number logic tests

Anonymous
2021-04-14T12:57:58+00:00

I have a simple IIF statement;

IIF ([Marks]>50,"Pass","Fail")

But Access returns a syntax error. I have tried the IIF statement with Dates it works. I can even add marks onto existing mark, meaning all functions works but only when the logic test has to deal with numbers then I have a problem. Please help!!!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} vote

14 answers

Sort by: Most helpful
  1. Anonymous
    2021-04-14T15:08:24+00:00

    Okay, I will try the Office Repair as well.

    Version 2103 (Build 13901.20336)

    0 comments No comments
  2. Anonymous
    2021-04-14T15:14:52+00:00

    I did this. It gives me exactly same checks as in your screenshot. I really don't think there's anything wrong with the code itself as those who have re-coded it came up with my exact code and it runs okay on their computers.

    0 comments No comments
  3. Anonymous
    2021-04-15T05:44:03+00:00

    Hi. Did you finally manage to figure out why the IIF is not working with number logic tests in Query Design, I still would like to know in case it's something I can turn off or on. SQL coding worked well so at least for now I can proceed with the project. I tried repairing Office.

    0 comments No comments
  4. Anonymous
    2021-04-15T08:11:47+00:00

    As your regional settings use semicolon as the separator, use:

    IIf([Marks]>50;"Pass";"Fail")

    2 people found this answer helpful.
    0 comments No comments