Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal reports time variable to give pass or fail

Posted on 2014-03-25
4
Medium Priority
?
411 Views
Last Modified: 2014-04-13
Hey,
I need to add a pass or fail to a report contingent upon a tech arriving on site within a specific time frame.
Example:

if {TIMESTMP.STATUS} = 50 (this is "arrived") and {TIMESTMP.TIMEENTER} (this gives actual time stamp of his arrival)  is LESS THEN or EQUAL to 4 hours from {TIMESTMP.STATUS} = 1 (this is when the ticket was created) then give me "PASS" ELSE "FAIL"
0
Comment
Question by:mikeg95
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 total points
ID: 39953961
I assume you have separate records for each status.
You need to group the report on the TicketID

Try this

In the report header and group header add a formula
Name - DeclVars
WhilePrintingRecords;
Global DateTimeVar TicketStart;
Global DateTimeVar TechArrived;
Global BooleanVar TechHasArrived;

TechHasArrived := False;
""

Open in new window

In the detail section add a formula
Name - SetTimes
WhilePrintingRecords;
Global DateTimeVar TicketStart;
Global DateTimeVar TechArrived;
Global BooleanVar TechHasArrived;

If {TIMESTMP.STATUS} = 1 then
    TicketStart := {TIMESTMP.TIMEENTER}
Else If {TIMESTMP.STATUS} = 50 then
(
    TechHasArrived := True;
    TechArrived:= {TIMESTMP.TIMEENTER};
);
""

Open in new window

In the group footer add a formula
Name - DisplayArrivedOnTime

WhilePrintingRecords;
Global DateTimeVar TicketStart;
Global DateTimeVar TechArrived;
Global BooleanVar TechHasArrived;
Local StringVar strOut;

If Not TechHasArrived then
    strOut := "No Tech"
Else If DateDiff('h',TicketStart,TechHasArrived) <= 4 then
    strOut := "Pass"
Else
    strOut := "Fail";
strOut

Open in new window



mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 39955568
Is TIMEENTER a datetime, or just a time?

 If it's just a time, mlmcc's second formula will need to be changed.

 Also, if it's just a time, can the time span include midnight?  For example, could STATUS 1 be at 11 PM and STATUS 50 be at 2 AM (3 hours later)?

 James
0
 

Assisted Solution

by:mikeg95
mikeg95 earned 0 total points
ID: 39956094
Hey mlmcc's Formula let me in the right direction but I was able to get this done a bit differently the field is just time. thanks for your input.
here is how it worked out. I separated the two times.

If {@Priority} = "P2" and  {@Settimes}- {@AArriveTime} <= 4 then

    "Pass"
Else IF {@Priority} = "P2" and  {@Settimes}- {@AArriveTime} >= 4 then
    "Fail"
Else ""
0
 

Author Closing Comment

by:mikeg95
ID: 39997124
thanks for your answers I would not have arrived to the conclusion without them
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question