I am newbie in Crystal Report.
I have created a stored procedure (Name:SP1) to return value.
Example of value return:
ID Data1
-------------------------
1 A
1 B
1 C
1 D
1 E
I have to map with another table (Name: TB1).
Example of table data:
ID Data2
--------------------------------------
1 B
1 C
At database connection, I link SP1 to TB1 (left outer join), pull out the result by row data as below:
ID Data1 Data2
----------------------------------------------------------
I would like to add a Count column.
Expected result:
ID Data1 Data2 Count
----------------------------------------------------------
1 A 0
1 B B 1
1 C C 1
1 D 0
1 E 0
If TB1.Data2 able map with SP1.Data1, i require to get the count = 1
I try on formula for count:
IF {SP1.Data1}={TB1.Data2} THEN
1
else
0
But it wont return 0, only return 1.. like below:
ID Data1 DataMap Count
----------------------------------------------------------
1 A
1 B B 1
1 C C 1
1 D
1 E
may i know what should i do to display the 0 as well? is the "IF {SP1.Data1}={TB1.Data2}" correct?
Thanks alot
Edited by crstar - 02 Aug 2012 at 10:55pm