Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count records Post Reply Post New Topic
Author Message
Lusco
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Online Status: Offline
Posts: 3
Quote Lusco Replybullet Topic: Count records
    Posted: 13 Nov 2008 at 3:44am
Hi,

I need to count records but with some exceptions.

This is the situation:

An employee gets one day of vacations if he has 12 extra hours. But we only can count if the employee has extra hours in all the working days.

For example:
Monday - 1 extra hour //COUNT - 1
Tuesday - 3 extra hours //COUNT - 4
Wednesday - 5 extra hours //COUNT - 9
Thursday - No extra hours - STOP COUNT
Friday - 3 extra hours //COUNT - 3
Saturday - 3 extra hours //COUNT - 6
Sunday - NO WORKING DAY
Monday - 6 extra hours //COUNT - 12 -> then 1 vacation day

The Database has a table with the NO WORKING DAYS (sundays and holidays), and another table with the registry of extra hours.

My report has a group by employee, and i've already create a formula to indicate the award (vacation days) . My problem is validating the data records. More information about data struture here: http://cowsonpatrol.org/downloads/report.zip

I'm using CR8.5.

Anyone can help me? Sorry about my bad english!

Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Nov 2008 at 6:29am
How are you getting the data?
 
If you are using a stored procedure, I would suggest doing it there, you could use a cursor and loop through each record and apply the logic to an extra hours column, and then in Crystal just see if the column is >= 12 and display the count.
 
If you are joining to the database directly, you would need to group and order by worker/day and then create a formula that applies your logic to a shared variable.  In essence, you are creating your own running total of extra hours in the detail section of the report.
 
Hope this helps
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.030 seconds.