Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a column of datatype money in mssql 2k5... colX...

i want to show this colx in two columns, col1 and col2 according to colY in crystalreport as:
res = 100.00
col1       col2     col3
10.00      0        90.00
0          1.00     91.00
0          5.00     96.00
50.00      0        46.00
.
.
but what i am getting now is:
res = 100.00
col1       col2     col3
10.00      0        100.00
0          1.00     100.00
0          5.00     100.00
50.00      0        100.00
.
.
Following is the formula i am using for col3...
VB
dim ob
ob={TABLE.res}
WhileReadingRecords
if {TABLE.colY}="C" then
    ob=ob-{TABLE.colX}
    formula=ob
else
   ob=ob+{TABLE.colX}
   formula=ob
end if
Please do answer if u have any solution or reference...
Posted
Updated 5-Feb-12 8:34am
v2

1 solution

Since you are adding running total of col1 and subtracting running total of col2, why don't you add two fields with theses running totals and then use
Col3 = 100 + runningtotal_of_Col1 - runningtotal_of_Col2
for display.

See if this works.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900