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!

Grouping on formula???

Status
Not open for further replies.

PQTIII

IS-IT--Management
Sep 21, 2004
110
Cr9

I'm trying to find a way to group on hours into a shift.
The hours are broke down in seconds: (7:10am -- 7:10pm), but there is no "hours into the shift" data field in the table.

Hour 1 = 0 ---- 3600
Hour 2 = 3601 ---- 7200
Hour 3 = 7201 ---- 10800
Hour 4 = 10801 ---- 14400
...
Hour 12= 39601 ---- 43200

I want to show total down times that happened within that hour,by hour for each piece of equipment.

(seconds into shift) data: eqmtid starttime endtime reason Code
MA141 3700 4000 1 21
MA141 33000 35000 2 34
MH843 2000 10000 1 24
MA141 40000 42000 3 1
MA141 5000 6000 1 99

OUTPUT:
Number of
Hour Down Time Events
MA141 1 0 0
2 1300 2
3 0 0
4 0 0
...
10 2000 1
11 0 0
12 2000 1

Thanks PT
 
Hi PT,

You might create a formula: @Hours_Into_ Shift

If (FN-secconds into shift-) in[ 0 to 3600]
Then 1
Elseif (FN-secconds into shift-) in[ 3601 to 7200]
Then 2
...and so on

Then group your results by @Hours_Into_ Shift.

Is this what you are looking for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top