-
Mar 31st, 2011, 03:49 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Condition sum function
In crystal report, for data showing at below:
QUANTITY----PAID_DAY
12------------2/2/2010
35------------
63------------5/15/2010
13------------
How to add code to sum of Quantity if there is a day in [PAID_DAY]?
The result showing on the report should be 12+63=75.
-
Mar 31st, 2011, 05:15 PM
#2
Re: Condition sum function
Is the field 'PAID_DAY', date data type ?
If so, then You could sum 'QUANTITY' using :
a)RunningTotal field
or
b)Formulas
Wichever You decide, the condition should be
Code:
{Table.PAID_DAY} <> Date(0,0,0)
JG
-
Apr 1st, 2011, 08:07 AM
#3
Thread Starter
Hyperactive Member
Re: Condition sum function
I tried to add a formula @quatity and drag it to group fooder of Order:
IF {Table.PAID_DAY} <> Date(0,0,0)
THEN SUM({Table.QUANTITY})
But did not see the result showing. Something wrong with my doing?
-
Apr 1st, 2011, 09:22 AM
#4
Re: Condition sum function
No, You should
1
add a formula field with next code
Code:
IF {Table.PAID_DAY} <> Date(0,0,0) THEN {Table.QUANTITY} Else 0
Place in detail section
Format the formula field to 'Supress'
Add a Summary to this formula field for the desired group
or
2
Insert a Running Total Field
Select the field
Evaluate using a formula
Click on x-2 button, it open the formula editor
Write the next condition
Code:
{Table.PAID_DAY} <> Date(0,0,0)
Reset in the desired change of group
and place the Running Total field in the desired group footer
JG
-
Apr 1st, 2011, 09:55 AM
#5
Thread Starter
Hyperactive Member
Re: Condition sum function
It works. Thank you so much.
I learned a lot of how to add a formula from you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|