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

Selection Criteria/Formula Help 1

Status
Not open for further replies.

TimothyP

Programmer
Aug 6, 2002
135
US
I am trying to create a Crystal 8.5 report against a SQL server table.

My SQL table looks something like this...

Emp
No Name Salary Fund
1 Smith 75,000 1200
1 Smith 4,000 1300
1 Smith 2,000 1400
1 Smith 3,000 1500
2 Harris 80,000 1200
2 Harris 2,000 1300
2 Harris 3,000 1400
2 Harris 6,000 1500
3 Jones 95,000 1200
3 Jones 4,000 1300
3 Jones 3,000 1400
3 Jones 3,000 1500
4 Rose 87,000 1200
4 Rose 3,500 1300
4 Rose 4,000 1400
5 Smith 76,000 1200
5 Smith 3,000 1300
5 Smith 3,000 1400
5 Smith 2,000 1500

Net Pay = fund 1200 + 1300
Pension Amt = fund 1400
Health Amt = fund 1500

How do I write a formula to calculate Net pay?

For example...

Emp No Name Net Pay Pension Amt Health Amt
1 Smith 79,000 2,000 3,000
2 Harris 82,000 3,000 6,000
3 Jones 99,000 3,000 3,000
4 Rose 89,500 4,000 0
5 Smith 79,000 3,000 2,000

======================
Crystal Reports 8.5
Database: SQL Server
 
Insert a group on {table.empno}. Create three formulas like:

//{@Net Pay}:
if {table.fund} in [1200,1300] then {table.salary}

//{@Pension}:
if {table.fund} =1400 then {table.salary}

//{@Healtlh}:
if {table.fund} =1500 then {table.salary}

Place these in the detail section and then right click each and insert a sum at the group level. Then suppress the details section and group header and drag the groupname and employee name into the group footer.

-LB
 
On the money as usual LB!

Thanks for the help.

======================
Crystal Reports 8.5
Database: SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top