thechazm
VBA, VB.net, C#, Java
- Local time
- Yesterday, 21:43
- Joined
- Mar 7, 2011
- Messages
- 515
I am trying to compare two queries data and show if the records match and the records that dont match in the output but grouping on if they match.
For instance: (Field values are deliniated by the ,)
Query 1:
11, NWP, AO, 5
11, NWP, A1, 2
11, NWP, A2, 7
Query 2:
11, NWP, AO, 5
11, NWP, A2, 7
11, NWP, A5, 10
So Query 1 has a value thats not in query 2. I need the data on the query to come out like this.
11, NWP, AO, 5
11, NWP, A1, 2
11, NWP, A2, 7
11, NWP, A5, 10
And if query 2 has the missing item to put it in the list as well.
Here are my two queries that I am trying to do this with.
And the second one.
Any guidance or help on this is greatly appreciated I may be going to wrong route with this and is why I am asking the question.
Either query may contain a couple different entries but I need to show all equal ones and all different ones in the same ending query.
Thanks
For instance: (Field values are deliniated by the ,)
Query 1:
11, NWP, AO, 5
11, NWP, A1, 2
11, NWP, A2, 7
Query 2:
11, NWP, AO, 5
11, NWP, A2, 7
11, NWP, A5, 10
So Query 1 has a value thats not in query 2. I need the data on the query to come out like this.
11, NWP, AO, 5
11, NWP, A1, 2
11, NWP, A2, 7
11, NWP, A5, 10
And if query 2 has the missing item to put it in the list as well.
Here are my two queries that I am trying to do this with.
Code:
SELECT [(Shop Sheets) Shop Commits AWeek Flat].Shops, [(Shop Sheets) Shop Commits AWeek Flat].[Project Name], [(Shop Sheets) Shop Commits AWeek Flat].TSD, nz([CountOfTSD],0)-nz([P Week],0) AS Difference
FROM [(Shop Sheets) Shop Commits AWeek Flat] LEFT JOIN [(Shop Sheets) Requested Reference] ON ([(Shop Sheets) Shop Commits AWeek Flat].TSD = [(Shop Sheets) Requested Reference].TSD) AND ([(Shop Sheets) Shop Commits AWeek Flat].[Project Name] = [(Shop Sheets) Requested Reference].[Project Name]) AND ([(Shop Sheets) Shop Commits AWeek Flat].Shops = [(Shop Sheets) Requested Reference].Shops);
And the second one.
Code:
SELECT [(Shop Sheets) Shop Commits AWeek Flat].Shops, [(Shop Sheets) Shop Commits AWeek Flat].[Project Name], [(Shop Sheets) Shop Commits AWeek Flat].TSD, nz([CountOfTSD],0)-nz([P Week],0) AS Difference
FROM [(Shop Sheets) Shop Commits AWeek Flat] LEFT JOIN [(Shop Sheets) Requested Reference] ON ([(Shop Sheets) Shop Commits AWeek Flat].TSD = [(Shop Sheets) Requested Reference].TSD) AND ([(Shop Sheets) Shop Commits AWeek Flat].[Project Name] = [(Shop Sheets) Requested Reference].[Project Name]) AND ([(Shop Sheets) Shop Commits AWeek Flat].Shops = [(Shop Sheets) Requested Reference].Shops);
Any guidance or help on this is greatly appreciated I may be going to wrong route with this and is why I am asking the question.
Either query may contain a couple different entries but I need to show all equal ones and all different ones in the same ending query.
Thanks