Selasa, 31 Oktober 2017

Re: [MS_AccessPros] FIELD JOIN IN QUERY

 

Thanks Duane,

it worked well for the sample data.  when applied to the real data i am evaluating, which is large, the query does not run but it says there is not space in temp or size greater than 2GB.

Any trick to go around this ?

Thanks.

Ade



From: "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, 30 October 2017, 19:31
Subject: Re: [MS_AccessPros] FIELD JOIN IN QUERY

 
Ade,
If I understand, create two union queries you need to have a unique value in each record. I used the Record column/field.

AdeQuni1
SELECT Record, Field1
FROM AdeTable1
UNION ALL
SELECT Record, Field2
FROM adeTable1
UNION ALL
SELECT Record, Field3
FROM adeTable1
UNION ALL
SELECT Record, Field4
FROM adeTable1
UNION ALL SELECT Record, Field5
FROM adeTable1;

and 
AdeQuni2
SELECT Record, Field1
FROM AdeTable2
UNION ALL
SELECT Record, Field2
FROM adeTable2
UNION ALL
SELECT Record, Field3
FROM adeTable2;

Then create a third query with SQL of
SELECT AdeQuni1.Record, AdeTable1.Field1, AdeTable1.Field2, AdeTable1.Field3, AdeTable1.Field4, AdeTable1.Field5
FROM AdeTable1 INNER JOIN (AdeQuni2 INNER JOIN AdeQuni1 ON AdeQuni2.Field1 = AdeQuni1.Field1) ON AdeTable1.Record = AdeQuni1.Record
GROUP BY AdeQuni2.Record, AdeQuni1.Record, AdeTable1.Field1, AdeTable1.Field2, AdeTable1.Field3, AdeTable1.Field4, AdeTable1.Field5
HAVING (((Count(AdeQuni1.Field1))=3));

Duane Hookom




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, October 30, 2017 11:25 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] FIELD JOIN IN QUERY
 


Please see below.

TABLE1
RecordField1Field2Field3Field4Field5
1129404148
2718193248
3624324850
419151925
5421343637
62329374550
71317192636
8417232730
9911132733
10316233239
TABLE2
RecordField1Field2Field3
122339
231632
331823
433944
5113239
OUTCOME
RecordField1Field2Field3Field4Field5
10316233239



From: "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, 30 October 2017, 15:31
Subject: Re: [MS_AccessPros] FIELD JOIN IN QUERY

 
Ade,

Again, can you provide some sample data and desired output? I think you would need to create union queries to normalize your table but I can't tell.

Regards,
Duane



From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, October 30, 2017 9:56 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] FIELD JOIN IN QUERY
 


Thanks Duanne,

i am trying to solve a problem with some combinatorics element. There is no unique ID in the first table that equates to another ID in the second.

While the first table contains all the possibilities, my desired outcome is only those lines or records in the first table that have a record from the second table as a subset regardless of the order.

The challenge is how to join both tables to achieve this result when i run a query


Ade



From: "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, 30 October 2017, 14:38
Subject: Re: [MS_AccessPros] FIELD JOIN IN QUERY

 
Ade,

It seems your tables aren't normalized correctly. Can you provide more information about what types of values you are storing? I am picturing something like storing EmployeeIDs  (40 different employees) in any of the fields with headings/field names that equate to positions or roles. If this is somewhat like you system, rather than 5 fields, there should be 5 records.

How would you join? Can you provide some sample records and desired output?

Regards,
Duane Hookom



From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, October 30, 2017 6:02 AM
To: ms_access_professionals@yahoogroups.com
Subject: [MS_AccessPros] FIELD JOIN IN QUERY
 


I am looking for help to create a join between two tables. Fields 1-5 in the first table can take on about 40 different unique values, while Fields 1-3 in the second table can also take on the same number of unique values. Fields 1 to 3 can each equate to any of the values in Fields 1-5 in the 1st table.

Thanks.

Ade

TABLE1
FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
TABLE2
FIELD1 FIELD2 FIELD3












__._,_.___

Posted by: Adeboyejo Oyenuga <aoye_99@yahoo.co.uk>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar