Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced MS Query stuff

Status
Not open for further replies.

jfgonzalez

Technical User
Apr 16, 2002
36
US
I'm real stumped over this one. Here's what I'm trying to do.

I created a spreadsheet with three workbooks in them. Each workbook contains data from a Query, in which I queried a view in SQL. Originally, my end result was to look something like this:

Worksheet 1: Master List

Invoice # 10234 ABC Company Invoice # 10234 ABC Company

And so on, where the query is taking data from two seperate SQL databases and matching them up by common invoice number.

The remaining two worksheets contain data in which invoices found in one but not the other are stored. They would return data along the likes of this:

Worksheet 2: Invoices found in Database #1 but not in Database #2

Invoice #876548 Acme Electric

And so on. Worksheet 3 would be similar, containing invoices found in database #2 but not in #1. Data in both these worksheets would not be in the Master Worksheet.

The common link I created between these two queries is linking a the fields INV_NO with DocumentName, both which contain the common invoice numbers. This has worked fine.

Now I want to further filter data down so that I am targeting dates. Because the date fields in both SQL tables are so different, I cast them into common date formats in a new field in the view called TRANS_DATE.

Now, this is what I want to do. I still want to match both sets of data up by invoice number, but I also want it to catch it by date so that if the dates don't match but the invoice does, it gets thrown into one of the two worksheets. It is this last part I am having so much trouble doing, and I've been pounding my head against the monitor in frustration for too long. Suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top