Hi,
I'm a newbie in writing triggers and would appreciate if you could please assist. I want to capture a startdatetime and enddatetime each time PtCt changes value, when this condition is met i.e If(PtCt = 0, Insert timestamp(StartDateTime)) and when the value of PtCt changes from 0 to any other value i.e. PtCt <> 0 to insert timestamp(EndDateTime) . To start a new line again for each PtN when PtCt = 0. Below is my expected output. Please note that PtN can have many occurrences during the day and my intention is to capture the record each time. Thanks in advance for assisting.
PtN PtCt StartDateTime EndDateTime
Pt1 4 02/07/2014 14:02:15 02/07/2014 15:02:15
Pt1 0 02/07/2014 15:02:15 02/07/2014 15:45:50
Pt2 27 02/07/2014 10:05:12 02/07/2014 10:45:11
Pt2 21 02/07/2014 09:13:00 02/07/2014 09:33:09
I'm a newbie in writing triggers and would appreciate if you could please assist. I want to capture a startdatetime and enddatetime each time PtCt changes value, when this condition is met i.e If(PtCt = 0, Insert timestamp(StartDateTime)) and when the value of PtCt changes from 0 to any other value i.e. PtCt <> 0 to insert timestamp(EndDateTime) . To start a new line again for each PtN when PtCt = 0. Below is my expected output. Please note that PtN can have many occurrences during the day and my intention is to capture the record each time. Thanks in advance for assisting.
PtN PtCt StartDateTime EndDateTime
Pt1 4 02/07/2014 14:02:15 02/07/2014 15:02:15
Pt1 0 02/07/2014 15:02:15 02/07/2014 15:45:50
Pt2 27 02/07/2014 10:05:12 02/07/2014 10:45:11
Pt2 21 02/07/2014 09:13:00 02/07/2014 09:33:09