title: SQL query to get list of active customers. Active are those that are in the table at least once each week
body: <p>I have a table that contains usage data for our customers - customerID, DateofUsage. So any day, the same customerID may occur multiple times. </p>
  
  <p>I want to figure out the list of active Customers. Active are those that have used the product at least once each week. </p>
  
  <p>When I use this :</p>
  
  <pre><code>    SELECT distinct [CustomerId], datepart(week, [Date]) FROM CustomerUsage
      group by [subscriptionid]
  </code></pre>
  
  <p>I get a list of CustomerIDs and which week they were used in. I try to extend this by doing this:</p>
  
  <pre><code>    SELECT distinct [CustomerId], COUNT(datepart(week, [Date])) FROM CustomerUsage
      group by [subscriptionid]
  </code></pre>
  
  <p>But now the numbers for count is all messed up. I was hoping to get the number of weeks the customer was active in and if that number was greater than the number of weeks so far, I have my list. Any idea what I am doing wrong?</p>