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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with expression

Status
Not open for further replies.

Ryon

Technical User
Nov 1, 2002
64
US
I need to work out a experession for a report, I need it to give the sum of the TOTALS column where the COMPDATE is between 0 to 30 days old. the TOTALS field and the COMPDATE are in the details section, and I was going to create a text box and put it in Control Source. Is this how I should do it?

Thanks AGAIN!!

Ryan
 
You might try a text box with something like

Code:
=Sum([TOTALS]*([COMPDATE] Between 0 And 30) * -1)

in it. The ([COMPDATE] Between 0 And 30) evaluates to true (-1) or false (0), so this can be used to multiply against the value in [TOTALS] - if the [COMPDATE] value isn't is range [TOTALS] gets multiplied by 0 and so has no effect on your sum. You need the * -1 on the end to make up for the fact that True evaluates to -1, not 1.

HTH. [pc2]
 
I tried that but all I get is a zero in the text box, I dont see where your expression references between now and and the previous 30 days. could you also explain to me why we multiply the sum of the totals column by the date.thanks for your time!!







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top