Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Entering multiple date parameters Post Reply Post New Topic
Page  of 2 Next >>
Author Message
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Topic: Entering multiple date parameters
     Posted: 08 Apr 2011 at 3:46am
I have a machine performance review that I have done daily by hand data-mining. It was not until this past work evening that I finally got the time to scavenge through our database and find the tables that I needed. I now have an adequate report, but there is one catch. I have a total for 24hrs, which is necessary, but I also need three separate sub categories breaking the 24hr total into three 8hr shifts. Easiest way i can think of is to have four separate reports but I cannot have that, I need all the information available at a single glance.

My question is:

Is there a way to pull data for an entire 24hr period in one row while having three separate rows pertaining to the same data but pulling in three separate 8hr increments.

Ex.


Press 1 Total        - Hours Run .. Quantity Run .. Run Speed
Shift1 0600-1400 - Hours Run .. Quantity Run .. Run Speed
Shift2 1400-2200 - Hours Run .. Quantity Run .. Run Speed
Shift3 2200-0600 - Hours Run .. Quantity Run .. Run Speed

Edited by JBrown.CM - 08 Apr 2011 at 4:07am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Apr 2011 at 3:56am
Create a formula based on whatever field you're getting for your timestamp.  I don't have Crystal on this workstation so I don't have the exact syntax, but it will look something like this:
 
If time({table.timestamp}) >= time(6, 0, 0) and time({table.timestamp}) < time(14, 0, 0) then "Shift 1"
else if time({table.timestamp}) >= time(14, 0, 0) and time({table.timestamp}) < time(22, 0, 0) then "Shift 2"
else "Shift 3"
 
Your first group in the report will be on some value that only occurs once in the report.  You need this in order to get your totals at the beginning of the report.
 
Your second group will be the formula you just created.  You can then create summaries to display the data rolled up to the 8-hour shift.
 
-Dell
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 4:15am
Thank you, that makes sense. I will try your solution as soon as I am able.
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 5:24am
Is there a way I can blanket that time stamp formula over each variable?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Apr 2011 at 5:38am
What do you mean by blanket?
 
To do the summaries, either click on the summary button (Sigma - looks like an angular E) or click on the Insert menu and select Summary.  Tell it which field you want, how you want to summarize it (sum, count, etc.) and which group you want to summarize it for.  The summary will appear in the group footer - you'll want to move it to where you want it and reformat the font and borders.
 
-Dell
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 8:19am
I have formulas that supply all of my sums.

For example

Work Center 7 Time
                 Run Run% M/R M/R%   Bad Bad%
                 6.0* 75%   1.0 12.5% 1.0 12.5%
*numbervar mr := Sum ({@TotalDecimalHours}, {PV_JobCosts.WorkcCode});

if mr <> 0 THEN
Sum ({@RunDecimalHours}, {PV_JobCosts.WorkcCode}) % mr
else
0;
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 8:19am
I don't know how I can explain an differently, but thank you for your help.
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 8:30am
brainstorm.

can create a new formula and select the already existing runhours formula and put a parameter on it that way? and just put new formulas in for each shift?
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 8:33am
time <=0600 >= 1400 {#GT2RunHours}

i tried that but it didn't work...
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 08 Apr 2011 at 9:10am
tried this

If time({#GT2RunHours}) >= time(6, 0, 0) and time({#GT2RunHours}) < time(14, 0, 0) then "Shift 1"
else if time({#GT2RunHours}) >= time(14, 0, 0) and time({#GT2RunHours}) < time(22, 0, 0) then "Shift 2"
else "Shift 3"

not quite it..

how can i learn this?
IP IP Logged
Page  of 2 Next >>
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