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

How to count Records based on a certain crieteria 1

Status
Not open for further replies.

rakeshjgd

Programmer
Oct 21, 2003
4
IN
How do I count Records based on a certain crieteria

The following are the fields in my Table
Emp Name Emp Code Dept Prstatus Date
Sam 1001 AC Present 9/22/2003
Sam 1001 AC Absent 9/23/2003
Mary 1002 BC Half Day 9/22/2003
Mary 1002 BC Present 9/23/2003

I want to count the no of days absent,present of half days taken by all the employees between two dates.My data is grouped by Dept and then by employee code. I am using crystal reports 8.5 with Access 2000

Thank You,

Rakesh
 
Dear rakeshjgd,

I would do the following 3 formulas:

//Present
if {Table.PRStatus} = "Present" then 1 else 0

//Half Day

if {Table.PRStatus} = "Half Day" then 1 else 0

//Absent
if {Table.PRStatus} = "Absent" then 1 else 0

Place each of the above formulas in the detail section of your report and then right click, insert summary, sum (you can choose grand totals and sum for each group)

There you go,

ro


Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top