Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Time zones calculation Post Reply Post New Topic
Author Message
Callie57
Newbie
Newbie
Avatar

Joined: 02 Jul 2012
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote Callie57 Replybullet Topic: Time zones calculation
     Posted: 23 Jan 2014 at 1:02am
I wonder if any one can help me please - I am trying to set up a report on availability of equipment during set time periods. The periods are 6 time slots over 24 hours 0-4 4-8 8-12 12-16 16-20 and 20-24. If the equipment is unavailable say from 0300 to 1215 I'd like to be able to report that it was unavailable for 1 hour in the 0-4 time zone, 4 hours in the 4-8 and 8-12 and 15 mins in the 12-16 zone. I'd like to do this over variable periods (say a Month or six months) but be able to add up the total time its been unavailable in each of the time zones for the period interrogated. Think this is a complicated one but any help would be greatly appreciated.
Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Jan 2014 at 5:32am
I'm not sure on this one.

I would use a stored proc, as it provides the writer the most flexibility...
If you don't/can't go the stored proc way
You might be able to accomplish this using a formula that would set several shared variables, breaking up the amount of time the equipment was offline into the different bins.

Now that I think of it, that probably wouldn't be too hard to do.
IP IP Logged
Callie57
Newbie
Newbie
Avatar

Joined: 02 Jul 2012
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote Callie57 Replybullet Posted: 23 Jan 2014 at 8:56pm

Thanks for responding so quickly! The table is 'equipment status history' and has fields with 'ID' 'time from' and 'time to' which are both date/time form. I would query the table for status 'unavailable' and add parameters for the date period. I have no idea what a stored proc is but any further help would be greatly appreciated.



Edited by Callie57 - 23 Jan 2014 at 8:59pm
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