Results 1 to 10 of 10
  1. #1
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10

    Question Please help with this query (IIF Query)


    IIF(And( [Units]<>"",[Amount(USD)]<>"", [Duty1]<>"",[Freight(USD)]<>"",[ Other]<>""),"Cost Final","Cost Not final")

    Error i am getting on running query " The expression you entered contains invalid syntax"

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What are you trying to do in plain english, then we can try to set up an expression.

  3. #3
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10
    I am doing in expression. I am saying if all these fields are not null then say cost is final otherwise cost is not final

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Try this

    IIF(Not IsNULL([Units] AND Not isNUll([Amount(USD)]) And Not IsNull([Duty1]) and Not IsNull([Freight(USD)]) and Not isNull([ Other]),"Cost Final","Cost Not final")

  5. #5
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10
    Thanks it's worked.

  6. #6
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10
    If i want to enter one more criteria for example country field equal to China. How i will write?

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    add it to the list same format

  8. #8
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10
    [country]="China" its not working

  9. #9
    vidplaylist is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    10
    I am waiting please help

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What is it you want to do?

    IIF(Not IsNULL([Units] AND Not isNUll([Amount(USD)]) And Not IsNull([Duty1]) and Not IsNull([Freight(USD)]) and Not isNull([ Other]) and [country]="China" ,"Cost Final","Cost Not final")

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

Similar Threads

  1. Select Query > Update Query > Table Field
    By tuggleport in forum Queries
    Replies: 2
    Last Post: 08-09-2012, 07:04 AM
  2. Replies: 5
    Last Post: 10-06-2011, 05:49 PM
  3. Replies: 2
    Last Post: 05-27-2011, 05:55 AM
  4. Replies: 2
    Last Post: 01-31-2011, 08:31 AM
  5. Replies: 1
    Last Post: 07-30-2010, 10:28 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