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

Crystal Report Formula Assistance 1

Status
Not open for further replies.

cyreports

Programmer
May 12, 2010
89
US
I need to take the Sum ({Data.Allowed}) where {Data.CPTCode} = 'D9450'. I also need a formula to SUM the same field where the {Data.CPTCode} does not equal 'D9450'.
 
Off the top of my head, so i will (as usual) apologize in advance for syntax or other errors, but i think this will give you the 2 values you are looking for.

//{Formula_D9450}
numbervar D9;
IF {Data.CPTCode}="D9450" then D9 := D9 + {Data.Allowed}
else D9 := D9;
D9


//{Formula_Not_D9450}
numbervar N9;
IF NOT({Data.CPTCode}="D9450") then N9 := N9 + {Data.Allowed}
else N9 := N9;
N9

 
Create two conditional formulas:

if {Data.CPTCode} = 'D9450' then
{Data.Allowed}

if {Data.CPTCode} <> 'D9450' then
{Data.Allowed}

Place these in the detail section and right click and insert sums on them at the group and/or report level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top