title: SQL detecting changes in a column
body: <p>I have a table in my database</p>
  <p>Events</p>
  <pre><code>Date,Time,EventCode
  1/1/2020, 7AM, F
  1/2/2020, 8AM, N
  1/3/2020, 9AM, S
  1/4/2020, 9AM, L
  1/6/2020, 9AM, Z
  </code></pre>
  <p>I am learning how to write a query that can detect when the EventCode changed from N to any value after N. We don't care about values prior to N.</p>
  <p>The date is provided because my query needs a start date and end date.
  Therefore if I am searching for data that occurred from 1/3/2020 to 1/6/2020, we would have NO data to report because there was no initial EventCode of N present.</p>
  <p>However if we modified the query to  1/2/2020 to 1/3/2020, we would get 2 rows. The first row (which is the row containing the EventCode N) and the row immediately after.</p>
  <p>Will be using SQL Server 2016 and SQL Server 2019</p>
  <p>Example Dataset</p>
  <pre><code>ID                                     EventType EventDateTime
  103917  C   2021-07-16 10:21:18.513
  103921  C   2021-07-16 10:49:04.050
  103921  C   2021-07-16 12:44:46.320
  103921  C   2021-07-16 12:44:46.327
  103921  C   2021-07-16 12:44:46.333
  103921  C   2021-07-16 12:44:46.340
  103921  C   2021-07-16 12:44:46.347
  103921  C   2021-07-16 12:44:46.353
  103921  N   2021-07-16 12:45:35.573
  103921  N   2021-07-16 12:45:35.577
  103921  N   2021-07-16 12:45:35.580
  103921  A   2021-07-19 22:00:05.807
  103921  A   2021-07-19 22:00:05.857
  103917  N   2021-07-21 08:38:23.817
  103917  N   2021-07-21 08:38:23.827
  103917  N   2021-07-21 08:38:23.830
  103917  N   2021-07-21 08:38:36.640
  103917  N   2021-07-21 08:38:36.653
  103917  N   2021-07-21 08:38:36.663
  103917  N   2021-07-21 08:38:36.667
  103917  N   2021-07-21 08:38:36.673
  103917  N   2021-07-21 08:38:36.677
  103917  N   2021-07-21 08:38:36.683
  103917  N   2021-07-21 08:38:36.687
  103917  M   2021-07-21 08:39:00.113
  103917  M   2021-07-21 08:39:00.120
  103917  M   2021-07-21 08:39:00.127
  103917  M   2021-07-21 08:39:00.130
  103917  M   2021-07-21 08:39:00.137
  103917  M   2021-07-21 08:39:00.143
  103917  M   2021-07-21 08:39:00.150
  103917  M   2021-07-21 08:39:00.153
  103917  M   2021-07-21 08:39:00.160
  103917  M   2021-07-21 08:39:00.163
  103917  M   2021-07-21 08:39:00.170
  103917  M   2021-07-21 08:39:00.173
  103917  M   2021-07-21 08:39:00.180
  103917  A   2021-07-21 08:39:06.613
  103917  A   2021-07-21 08:39:06.617
  103917  A   2021-07-21 08:39:06.623
  103917  A   2021-07-21 08:39:06.630
  103917  A   2021-07-21 08:39:06.633
  103917  A   2021-07-21 08:39:06.637
  103917  A   2021-07-21 08:39:06.643
  103917  A   2021-07-21 08:39:06.647
  103917  A   2021-07-21 08:39:06.650
  103917  A   2021-07-21 08:39:06.657
  103917  A   2021-07-21 08:39:06.657
  103917  A   2021-07-21 08:39:06.660
  103917  A   2021-07-21 08:39:06.667
  103917  A   2021-07-21 08:39:06.667
  103917  A   2021-07-21 08:39:06.673
  103917  A   2021-07-21 08:39:06.677
  103917  A   2021-07-21 08:39:06.683
  103917  A   2021-07-21 08:39:06.690
  </code></pre>
  <p>I made up two random 6 digit ID #'s and placed them in the table and produced the results (sorted by EventDateTime column)</p>
  <p>I need to know when the status changes from 'N' to anything else for a specific ID.</p>
  <p>I am hoping to produce a new table which contains a subset of ID numbers and EventType and the EventDateTime which meets the conditions.</p>