Question: I posted about this a few weeks ago, but I don't think I asked the question clearly because the answers I got were not what I was looking for. I think it's best to start again.

I'm trying to query a database to retrieve the number of unique entries over time. The data looks something like this: 

`Day` | `UserID`  

1 | A  

1 | B  

2 | B  

3 | A  

4 | B  

4 | C  

5 | D

I'd like the query result to look this this

Time Span | COUNT(DISTINCT `UserID`)  

Day 1 to Day 1 | 2  

Day 1 to Day 2 | 2  

Day 1 to Day 3 | 2  

Day 1 to Day 4 | 3  

Day 1 to Day 5 | 4 

If I do something like 

```
SELECT COUNT(DISTINCT `UserID`) FROM `table` GROUP BY `Day`

```

, the distinct counts will not consider user IDs of previous days.

Any Ideas? The data set I'm using is quite large, so multiple-queries and post processing takes a long time (that's how I'm currently doing it).

Thanks

Answer: 
I don't see anywhere that you are initializing the Subordinates member, so I suspect that it still has the default value which is `null` (*not* the empty list). The fix is to initialize it to an empty list in the constructor:

```
public Manager(Person person, DateTime hiredate) : base(person, hiredate)
{
    Subordinates = new List<Interface.IEmployee>();
}

```
> 
> indexer returns IEmployee interface but not a class instance. Am I right?
> 
> 
> 

You don't right indexer must return instance, create instance from interface impossible.

I think this.company[SalesPerson02.GetHashCode().ToString()] returns null cause you don't add SalesPerson02 instance to your company object.