Results 1 to 5 of 5
  1. #1
    bbylls is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Dec 2009
    Posts
    33

    IIF() in a query calculation

    I am trying to create a column in a query based on a Yes/No column:


    IIF([column1]=0,calculation1,calculation2)
    column1 being the Yes/No column. Everything I have read said this should work, but it gives me an error on the form.
    I know the calculations work because I have used them in:
    IIF([column2]='A' or [column2]='B',calculation1,calculation2)
    Or could it be some setting in the form text box?
    Thanks for any help.

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    What is the error?
    You could always add column1 to the query to check what data is coming through.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you working with a query or a form? What are Calculation1 and 2?

  4. #4
    bbylls is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Dec 2009
    Posts
    33
    Gentlemen,
    I humbly apologize. It was operator error in the syntax.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad you were able to locate the problem but it would be nice if you went ahead and showed us what you fixed so others can learn. You could also follow the link in my sig and mark this thread as Solved.

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

Similar Threads

  1. Calculation Help
    By edge5511 in forum Programming
    Replies: 4
    Last Post: 12-18-2015, 11:11 AM
  2. Query Calculation
    By kellyd in forum Queries
    Replies: 5
    Last Post: 08-31-2009, 11:14 AM
  3. crosstab query calculation
    By rutica in forum Queries
    Replies: 2
    Last Post: 04-28-2009, 09:52 AM
  4. Calculation is off by a few cents...
    By Jule in forum Reports
    Replies: 3
    Last Post: 05-01-2006, 01:06 PM
  5. Calculation
    By thestclair in forum Reports
    Replies: 1
    Last Post: 04-29-2006, 11:03 AM

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