I have been working on an export file(csv) for a while now that is giving me nothing but headaches. The file is returning all of the correct data that I am wanting, but it is writing it to the file three times. Each record would have 3 times the data each time the file is exported.
I first thought the problem might be my Select statement. My JOIN clause is correct and the Select statement is returning the correct amount of rows. I now know the problem resides in my code somewhere.
This is a very complicated export(not so much the code, but just understanding what happens). I was hoping someone could evaluate a large chunk of the export code for me. It is a rather large piece of code, so rather than cluttering a screen with it, I would like to ask if anyone would mind evaluating via email. If not, let me know a viable means.
I have added the attachment. I have changed alot of things in the code since some of it shouldn't be made public :-) So if there is anything inconsistent, I apologize. Should give an idea as to what I am wanting to accomplish though. Within the zip, there are 2 excel files and 1 Word doc. The word doc explains what I am trying to accomplish and the 2 excels contain a.) The data within one of the tables I am using(very small) and b.) my current export