Results 1 to 2 of 2
  1. #1
    manzo is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2011
    Posts
    1

    Keep getting syntax error (comma) in query question

    I'm trying to to nested iif statements. I copied it down just like my professor did and it's not working for me. Here is the formula.
    " Depth_Level: IIf([Depth]<15="surface",IIf([Depth]<40="shallow",IIf([Depth]<100="medium","deep"))) "


    To the left of this field would be the label Depth with a bunch of numbers.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    You might want to look at the professor's example again. It should be:
    IIf([Depth]<15,"surface",IIf([Depth]<40,"shallow",IIf([Depth]<100,"medium","deep")))

    Where you have = signs should be commas.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Question: SigmaPlot macro syntax error
    By Captain Database ...!! in forum Import/Export Data
    Replies: 2
    Last Post: 03-27-2012, 10:04 AM
  2. syntax error in query
    By zoe.ohara in forum Queries
    Replies: 6
    Last Post: 04-23-2011, 04:58 AM
  3. syntax in query expression #ERROR help!
    By manos39 in forum Queries
    Replies: 1
    Last Post: 02-26-2011, 12:21 PM
  4. Syntax error (comma) in query expression?
    By TheWolfster in forum Queries
    Replies: 5
    Last Post: 05-10-2010, 12:02 PM
  5. Syntax error (comma) in query expression
    By KLynch0803 in forum Programming
    Replies: 3
    Last Post: 01-18-2010, 03:35 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