Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate percentage

Status
Not open for further replies.

ejerblom

Technical User
Sep 22, 2003
10
SE
Hi,

I'm a new user of Crystal reports and I'm not familiar with the formula yet so I hope someone can help me.

Problem description
An incident have a reported date and a resolved date. My task is to calculate the percentage of incidents solved within 1 hour.

My soultion (that is not working)

@Timediff
DateDiff ("h", {Incident.AZReportedDate}, {Incident.AZ_ResolvedDate}) //Calculate the timedifference (works)

@less1h
@Timediff <= 1

Then my idé was to count @less1h but that doesn't seem to work. And then divide all incidents with the counted @less1h.

But there might be a better way to calculate this?

Regards
Ulrika
 
Try the Following

@Timediff

if DateDiff (&quot;h&quot;, {Incident.AZReportedDate}, {Incident.AZ_ResolvedDate}) <= 1 then
1
else
0;

Now you should be able to sum the @timediff

 
Thank you very much, it worked very well.

Have a nice day!

/u
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top