title: SQL Query to Count IDs
body: <p>I'm trying to write a SQL Query in MS Access to count the number of times each ID appears in a data set. The data set is formatted as follows:</p>
  
  <pre><code>ID    Time
  1     12345
  1     12346
  1     12350
  2     99999
  2     99999
  </code></pre>
  
  <p>If the <strong>Time</strong> for one <strong>ID</strong> is within 3 seconds of another <strong>Time</strong> for that same <strong>ID</strong>, I only want it to be counted once. So the results should look like this:</p>
  
  <pre><code>ID    Count
  1     2
  2     1
  </code></pre>
  
  <p>The time column is not formatted as a datetime, so I can't use the datediff function. Any help would be appreciated.</p>