<p>I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.</p>

<p>Something like:</p>

<pre><code>Record.find(:all).date.unique.count 
</code></pre>

<p>but of course, that doesn't seem to work.</p>

What you're going for is the following SQL:
```
```
SELECT COUNT(DISTINCT date) FROM records
```
```
ActiveRecord has this built in:
```
```
Record.count('date', :distinct => true)
```
```