A bit of background: I'm working for an organization with a large number of users running reports in excel. Often they require macros which compare two sets of data against each other. A large portion of my work involves tuning specific change report macros. Not pretty, but it pays the bills.

I had an idea today to pull excel tables into an ADODB object in vba and then run SQL against the object. Everything seemed to work well... but then I came across odd behavior.

This returns all the names in table1 where a.Name isn't in table2. And it works fine, but some of the names come up multiple times.

```
SELECT a.Name FROM [Table1] AS a
LEFT JOIN [Table2] AS b
ON a.Name = b.Name
WHERE b.Name IS NULL

```

Adding a DISTNCT clause:

```
SELECT DISTINCT a.Name FROM [Table1] AS a
LEFT JOIN [Table2] AS b
ON a.Name = b.Name
WHERE b.Name IS NULL

```

Completely changes which names appear. What shows up is DISTINCT, but present in both tables.

I tried rewording it a s a GROUP BY to replace the distinct value and recieved the same results. I checked with the local guru and got no where. Next step is to install a real database here to run some tests on.

I'm perplexed though.