I have a stored procedure that executes the query attached (Sample Query). The result of the query is similar to this:
Name Acc_No Pol_No Date_Sold Product
David 121822 P001 2012-06-12 Prod001
Tim 121822 P054 2012-04-14 Prod009
Sarah 121822 P066 2012-06-26 Prod001
What we are looking for is people with different names but the same account number, as in the example above. I then need to note the earliest date sold (per account num), as that will be the correct account number and the rest will have to be corrected.
I need to put the results in an Excel spreadsheet that looks like the attached (Sample format Excel). I have the query correct, I just have no idea how to get the results printed to Excel in that format.