Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: problem with record selection formula Post Reply Post New Topic
Author Message
mardigras
Newbie
Newbie


Joined: 06 Oct 2008
Location: United States
Online Status: Offline
Posts: 1
Quote mardigras Replybullet Topic: problem with record selection formula
     Posted: 06 Oct 2008 at 7:01am
I am in the process of writing a report that shows clock in and clock out information for our employees. The problem i am encountering is the fact that being that we are a 24 hour operation, we have some employees that punch in on Saturday which is the last day of our pay period and punch out on Sunday which is the first day of a new pay period. Originally I had this, which executed very quickly, but didnt display any punches where the punch in was on Saturday and the punch out was on Sunday:
 
{Jobcode_Master.jobcode_id} = {?Jobcode ID} and
{Emp_Clock_Data.adjusted_clockin_dttime} in {?Week Start Date} to {?Week End Date} and
{Emp_Clock_Data.adjusted_clockout_dttime} in {?Week Start Date} to {?Week End Date}
 
So to include those missing punches, I came up with this which does work, but takes nearly 5 minutes to execute:
 
{Jobcode_Master.jobcode_id} = {?Jobcode ID} and
{Emp_Clock_Data.adjusted_clockin_dttime} in {?Week Start Date} to {?Week End Date} or
{Jobcode_Master.jobcode_id} = {?Jobcode ID} and
{Emp_Clock_Data.adjusted_clockout_dttime} in {?Week Start Date} to {?Week End Date}
 
I have been racking my brain on this for several days now and just cant figure out what makes the second record selection formula take so long. Does anyone have any ideas? Thanks in advance.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Oct 2008 at 9:39am

Five minutes sounds like a really long time to run this logic. I think that adding parentheses might help a little. This way if part of the logic within the parentheses fails, it can skip the second part. With no parentheses, it can be doing useless tests. It's worth a shot.

Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
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