having a hard time running sum on a unbound control

D

dp

Hi,

I have a very complex expression in an unbound control that i want to sum in
a group footer. It seems to only take the first value of the control i have
set to running sum over group.

I tried to put the expression in a sum function and the report blew up real
good.
something like this:
=Sum(IIf(nz([CommissionsDate] Between
CDate([Forms]![CommissionsReporter]![RptDateFrom]) And
CDate([Forms]![CommissionsReporter]![RptDateTo]),2)=True Or
nz([CommissionsDate] Between
CDate([Forms]![CommissionsReporter]![RptDateFrom]) And
CDate([Forms]![CommissionsReporter]![RptDateTo]),2)=2,[CommEarned],0))

And I also tried this function like the example on this page and it doesnt
work, it keeps resetting the group total on each detail line.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;208850

any suggestion would be helpful
 
D

Duane Hookom

Why are you using Nz() to return either True or a 2? Actually in IIf() these
two expressions are the same:
IIf(2,"Yes","No")
and
IIf(True,"Yes","No")
They will both return "Yes".
Are you trying to trap for either date control being Null?
You might want to try:
=Sum(Abs([CommissionsDate] Between
CDate([Forms]![CommissionsReporter]![RptDateFrom]) And
CDate([Forms]![CommissionsReporter]![RptDateTo]),2)) * [CommEarned])
 

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