Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If and Dsum control on report problem 1

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
Hello,

I have the following field on the report that works fine -
=IIf(IsNull(DSum("[Amount]","Qry_Information","[ObjectClass] = 'Travel' AND [FiscalYear] = Forms!Frm_Main_Menu.Combo28 AND [Month] < 4")),0,DSum("[Amount]","Qry_Information","[ObjectClass] = 'Travel' AND [FiscalYear] = Forms!Frm_Main_Menu.Combo28 AND [Month] < 4"))

Now i had to add another field called estimated amount (EstAmount). If the Amount field is 0 then use the EstAmount field. If the Amount field > 0 then use that field. How do I incorporate another IIF statement?

I use the Amount field for the first part of the IIF above.
 
Add the first line below, then add your existing statement, plus another ) at the end of the whole statement.

=IIf([Amount]=0,[EstAmount],
IIf(IsNull(DSum("[Amount]","Qry_Information","[ObjectClass] = 'Travel' AND [FiscalYear] = Forms!Frm_Main_Menu.Combo28 AND [Month] < 4")),0,DSum("[Amount]","Qry_Information","[ObjectClass] = 'Travel' AND [FiscalYear] = Forms!Frm_Main_Menu.Combo28 AND [Month] < 4")))



Thanks for the help.
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top