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

Possible to do a "selective" summary operation? 1

Status
Not open for further replies.

Firemyst

Programmer
Mar 10, 2003
62
US
Hi there,

I want to be able to do something like the following:

sum ({database_table.exp} WHERE database_table.month=x AND database_table.year=y AND database_table.div='abc' AND database_table.divtype='Activity')

Is this possible? If so, what do I need to do? I need to be able to do this, and assign the value to a shared variable before any of my "groups" run.

Thanks!
 
Dear Firemyst:

The easiest thing to do is to create a formula that tests for that compliance to criteria and if so prints the value else 0.

Here is an example:

If database_table.month=x AND
database_table.year=y AND
database_table.div='abc' AND database_table.divtype='Activity' then {database_table.exp}
else 0

Insert the formula into the detail section, right click and choose Insert Summary /Sum it should give you the totals you are looking for as only the ones that met your critieria would contain a value and the rest would be 0. If I have misunderstood your questions, please provide more informaton and I will be happy to help.
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top