at one point, built a .NET project that used the quickbooks connector from http://www.rssbus.com/
with that, and some minor configuration in quickbooks to allow remote access, i was able to see all the "tables" that exist in the quickbooks database live, and then could query them, use LINQ to join them together, export them out to a SQL server database or to disk or anything i wanted to;
I used the 30 day trial as a proof of concept, and then the company i was consulting for bought a license to go with the application.
the one thing at the time, that i felt that was lacking, was the ability to read the relationship between an invoice detail line items that exist on an invoice, and where/how they were tied to items in the ledger; that was with the RSS 1.0 version, and it's several versions worth of improvements since then.
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!