Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Selection Statement Post Reply Post New Topic
Author Message
harry8929
Newbie
Newbie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 2
Quote harry8929 Replybullet Topic: Selection Statement
     Posted: 27 Sep 2012 at 12:24pm
I am having an issue in trying to get a selection statement completed.

I have 3 fields and 4 parameters I am trying to work with:
txdate(date) i.e. 9/26/2012
labstarttime(string) i.e. 0584
endstarttime(string) i.e. 1426
[?]startdate
[?]enddate
[?]starttime (2 options; 0600 or 1800)6am to 6 pm shifts
[?]endtime (2 options;0600 or 1800) 6am to 6 pm shifts

I think I have it all with this selection formula:
{PV_JobCosts1.LabEndTime} < {?EndTime} and
{PV_JobCosts1.LabStartTime} > {?StartTime} and
{PV_JobCosts1.TxnDate} in {?StartDate} to {?EndDate}

BUT I have found a few transactions that do not pass muster. My parameters are ?StartDate and ?Enddate are 9/26/2012 and ?starttime=0600 and ?endtime=1800.

I have two records that come up up with:
date,starttime,endtime
9/26/2012,2344,0000
9/26/2012,1929,0000

I am sure the endtimes being 0000 are the problem, but I am not sure how to correct it.

Does anyone have any good thoughts?
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 28 Sep 2012 at 5:07am
why would you need to have 4 parameters? if the shifts are always 12 hours, could should only need to ask Shift 1 or 2
IP IP Logged
harry8929
Newbie
Newbie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 2
Quote harry8929 Replybullet Posted: 28 Sep 2012 at 5:24am
They do not necessarily want to only see it by shifts. They may want to just look at one shift or they may want it to run for a "24 hour" period (6am to 6am) or they may want to look at it for a week (Sunday to Saturday).
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 28 Sep 2012 at 5:28am
First thing that jumps out at me is, you should have <= >= in the time parms, however, there is more.

If someone starts at 5:15am on a day, do you want this to show? like on Sept 26th in the report?
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