Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: trying to get ink toning time from: Post Reply Post New Topic
Author Message
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Topic: trying to get ink toning time from:
     Posted: 11 Apr 2011 at 8:30am
I still haven't solved my first problem but I have ordered this websites book and it is on the way. Hopefully that help me to learn what I am doing.

I need to gather ink toning time, and to do that I think I need to pull from two or possibly three different tables.

Ink Toning Time

PV_Department.DeptName - want it to to only select "press"

PV_Operation.OperationCode - want it to only select "31"

*Also, here is the weird part. When I went back and looked at how my other totals were gathered it looked something like this.

if {PM_CompanyOption.LabourTimeFormat} = 0 then
truncate({#GT2RunHours}/3600) +
    truncate({#GT2RunHours} - (truncate({#GT2RunHours}/3600) * 3600))/6000
else
({#GT2RunHours}/3600);

So, I wonder if I need that third table PM_CompanyOption.LabourTimeFormat to calculate the time spent?

Thank you, and I apologize for my ignorance. I am learning and my first step is finding out how to learn. I jumped in head first and am having trouble.
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 11 Apr 2011 at 8:58am
if ({PV_Department.DeptName}) = "Press" and ({PV_Operation.Operationcode}) = "31" then truncate (({PV_JobCosts.LabourSecs})/86400)

that's what i have listed right now, the formula is passable which is a first for me, but i do not know exactly what truncate means I just thought that maybe it would give me the hours that i wanted.
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 11 Apr 2011 at 9:12am
sum (({PV_JobCosts.LabourSecs})/3600) if ({PV_Department.DeptName}) ="Press"; and ({PV_Operation.Operationcode}) ="31"

i thought i was on to something with this one, but apparently,from the "if" onward it doesn't appear to be part of a formula.
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 11 Apr 2011 at 9:28am
latest attempt, added an "else" clause.. or attempted to.

sum (({PV_JobCosts.LabourSecs})/3600)
if ({PV_Department.DeptName}) ="Press"
and if ({PV_Operation.Operationcode}) ="31;
else ="N/A"

still, to no avail
IP IP Logged
JBrown.CM
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 14
Quote JBrown.CM Replybullet Posted: 11 Apr 2011 at 9:45am
got another passable formula that looks to be just what i wanted but it's just not giving me the right info

if ({PV_Department.DeptName})="Press" and ({PV_Operation.Operationcode})="31" then ((sum ({PV_JobCosts.LabourSecs}))/3600) else 0

btw i am just learning boolean logic and crystal syntax

Edited by JBrown.CM - 11 Apr 2011 at 9:49am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 11 Apr 2011 at 9:51am

1 sum (({PV_JobCosts.LabourSecs})/3600)
2 if ({PV_Department.DeptName}) ="Press"
3 and if ({PV_Operation.Operationcode}) ="31;
4 else ="N/A"


I'm assuming you meant "take the sum if deptname = "Press" and op code = "31"


if ({PV_Department.DeptName}) ="Press" and ({PV_Operation.Operationcode}) = "31" then
   CStr(sum (({PV_JobCosts.LabourSecs})/3600))
else
   "N/A"


Type conversion is required because a formula can't return multiple types.

Edited by Keikoku - 11 Apr 2011 at 9:52am
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