S
SRaper
Hi,
I have been creating databases for years, however I have a type of problem
that I have never faced before, and cant see the trees through the forest.
I want to calculate the amount of time Device B is "On", only when a second
independent variable Device A is "On" as well. I now how to flag when these
conditions are true, but I cant see how to do the calculation with the way
the data is formatted, and don't know how to reformat it to get it done.
Here is an example of the data set I have
1 01/01/2004 04:35:00 Device A On
2 01/01/2004 05:25:00 Device A Off
3 01/01/2004 05:35:00 Device B On
4 01/01/2004 07:25:00 Device B OFF
5 01/01/2004 09:45:00 Device A On
6 01/01/2004 10:15:00 Device B On
7 01/01/2004 10:25:00 Device A Off
8 01/01/2004 11:15:00 Device B Off
The calculated value for this data set would be 10 minutes, as the only time
the above conditions were true was when
in line 5 Device A came on, the in line 6 Device B came on, however it
became false in line 7 when Device A shut off.
My issue is I cant understand how to get the date/time values in a format
which will allow me to do the calculations.
I would appreciate any help or direction you may be able to give.
Sincerely,
Stephen Raper.
I have been creating databases for years, however I have a type of problem
that I have never faced before, and cant see the trees through the forest.
I want to calculate the amount of time Device B is "On", only when a second
independent variable Device A is "On" as well. I now how to flag when these
conditions are true, but I cant see how to do the calculation with the way
the data is formatted, and don't know how to reformat it to get it done.
Here is an example of the data set I have
1 01/01/2004 04:35:00 Device A On
2 01/01/2004 05:25:00 Device A Off
3 01/01/2004 05:35:00 Device B On
4 01/01/2004 07:25:00 Device B OFF
5 01/01/2004 09:45:00 Device A On
6 01/01/2004 10:15:00 Device B On
7 01/01/2004 10:25:00 Device A Off
8 01/01/2004 11:15:00 Device B Off
The calculated value for this data set would be 10 minutes, as the only time
the above conditions were true was when
in line 5 Device A came on, the in line 6 Device B came on, however it
became false in line 7 when Device A shut off.
My issue is I cant understand how to get the date/time values in a format
which will allow me to do the calculations.
I would appreciate any help or direction you may be able to give.
Sincerely,
Stephen Raper.