Results 1 to 2 of 2

Iff

  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    Iff

    Hello ,
    I need set two iif from union query in report >
    I have done this :
    =IIf(Client=”1”,(Sum(IIf([Code]="001" Or [Code]="008" Or [Code]="011" Or [Code]="021",[GrossAmount],0),0))


    =IIf(Client=”2”,(Sum(IIf([Code]="001" Or [Code]="008" Or [Code]="011" Or [Code]="021",[GrossAmount],0),0))
    I nedd to sum Gross Amount based on client thta can be 1 or 2 in the same report .
    It doesn't work .
    Thank you foir advise.
    Boris

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    =IIf(Client=”1”,.......
    Is the field type of "Client" TEXT or a NUMBER?

    "1" is text

    1 is a number

    "1" <> 1

    You could try:
    Code:
    =IIf(Client= 1,(Sum(IIf([ Code ]= "001" Or [ Code ]= "008" Or [ Code ]= "011" Or [ Code ]= "021",[GrossAmount],0),0))
    =IIf(Client= 2,(Sum(IIf([ Code ]= "001" Or [ Code ]= "008" Or [ Code ]= "011" Or [ Code ]= "021",[GrossAmount],0),0))

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

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