runningphan
MIS
I have kind of a tricky time difference calculation (well, tricky for me ).
I need to calculate the difference between date/time fields in different records. Each record can have one of three types (started = 3, stopped = 4, and finished = 6) and then the status type date/time. Well, I need to calculate the difference between the start and stop records and if there isn't a stop record between the started and finished record the difference between the started and finished record.
Scenario 1
Record 1: {table.status} = 3 {table.status_date} = 5/18/2006 9:30:00 AM
Record 2: {table.status} = 4 {table.status_date} = 5/18/2006 9:35:00 AM
Record 3: {table.status} = 3 {table.status_date} = 5/18/2006 9:50:00 AM
Record 4: {table.status} = 4 {table.status_date} = 5/18/2006 9:57:00 AM
Record 5: {table.status} = 6 {table.status_date} = 5/18/2006 9:58:00 AM
This would produce a calculated time of 12 min.
Scenario 2
Record 1: {table.status} = 3 {table.status_date} = 5/18/2006 9:30:00 AM
Record 2: {table.status} = 6 {table.status_date} = 5/18/2006 9:58:00 AM
This would produce a calculated time of 28 min...
Any insight on this would be GREAT!!!!
Thanks a bunch.
I need to calculate the difference between date/time fields in different records. Each record can have one of three types (started = 3, stopped = 4, and finished = 6) and then the status type date/time. Well, I need to calculate the difference between the start and stop records and if there isn't a stop record between the started and finished record the difference between the started and finished record.
Scenario 1
Record 1: {table.status} = 3 {table.status_date} = 5/18/2006 9:30:00 AM
Record 2: {table.status} = 4 {table.status_date} = 5/18/2006 9:35:00 AM
Record 3: {table.status} = 3 {table.status_date} = 5/18/2006 9:50:00 AM
Record 4: {table.status} = 4 {table.status_date} = 5/18/2006 9:57:00 AM
Record 5: {table.status} = 6 {table.status_date} = 5/18/2006 9:58:00 AM
This would produce a calculated time of 12 min.
Scenario 2
Record 1: {table.status} = 3 {table.status_date} = 5/18/2006 9:30:00 AM
Record 2: {table.status} = 6 {table.status_date} = 5/18/2006 9:58:00 AM
This would produce a calculated time of 28 min...
Any insight on this would be GREAT!!!!
Thanks a bunch.