IIF Statement with 2 Criteria

B

Brennan

Hello:

I am using the following code in a control on a report
footer:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0))

I need the IIF statement to check for another value so I
used the following syntax:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0)OR IIf([tblBids_Status]="Pending-GC Has Job",
[2001],0))

The second statement does not return the correct
information. For 2001, my value should be $198,500 but
the 2nd statement returns a value of -($2)

Any comments or suggestions would be appreciated.

Thanks
Brennan
 
F

Fons Ponsioen

Hi.
Change the IIF statement to:
=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded" OR
([tblBids_Status]="Pending-GC Has Job",[2001],0)
Hope this helps
Fons
-----Original Message-----
Hello:

I am using the following code in a control on a report
footer:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0))

I need the IIF statement to check for another value so I
used the following syntax:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0)OR IIf([tblBids_Status]="Pending-GC Has Job",
[2001],0))

The second statement does not return the correct
information. For 2001, my value should be $198,500 but
the 2nd statement returns a value of -($2)

Any comments or suggestions would be appreciated.

Thanks
Brennan
.
 
S

Steve Schapel

Brennan,

Thought I would jump in as I noticed a slight typo with a rogue ( in
Fons's otherwise correct advice.
=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded" OR
[tblBids_Status]="Pending-GC Has Job",[2001],0)

Another way it could be done...
=Sum(IIf([tblBids_Status] In("Pending-GC Not Awarded","Pending-GC Has
Job"),[2001],0)

--
Steve Schapel, Microsoft Access MVP


Fons said:
Hi.
Change the IIF statement to:
=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded" OR

([tblBids_Status]="Pending-GC Has Job",[2001],0)
Hope this helps
Fons
 
B

Brennan

Thanks for your help. I tried the code you supplied and
I am getting the following error

Syntax error in query expression 'First([>>=Sum(IIf
([tblBids_Status]="Pending-GC Not Awarded" OR
([tblBids_Status]="Pending-GC Has Job",[2001],0)])'

Any ideas

Thanks
Brennan



-----Original Message-----
Hi.
Change the IIF statement to:
=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded" OR
([tblBids_Status]="Pending-GC Has Job",[2001],0)
Hope this helps
Fons
-----Original Message-----
Hello:

I am using the following code in a control on a report
footer:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0))

I need the IIF statement to check for another value so I
used the following syntax:

=Sum(IIf([tblBids_Status]="Pending-GC Not Awarded",
[2001],0)OR IIf([tblBids_Status]="Pending-GC Has Job",
[2001],0))

The second statement does not return the correct
information. For 2001, my value should be $198,500 but
the 2nd statement returns a value of -($2)

Any comments or suggestions would be appreciated.

Thanks
Brennan
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top