Seamus2626
asked on
Cannot join memo field
Hi,
I have SQL code and im trying to join memo fields
Is someone able to add the line of SQL
Where Left([INPUT D2 DATA].[Customer Type], 255) = Left([Calculation D2].[Client Type], 255
Im new to SQL so keep getting the syntax wrong.
Many thanks
SELECT INPUT_D2_all.ID, INPUT_D2_all.ClientID, INPUT_D2_all.[Customer Type Family], INPUT_D2_all.[Customer Type], INPUT_D2_all.LoB, INPUT_D2_all.Segment, INPUT_D2_all.[Business Type], INPUT_D2_all.[Employment Status], INPUT_D2_all.[Key controller flag], INPUT_D2_all.[Country of Incorp/ Registration / Trust Est], INPUT_D2_all.[Country of Primary Operation], INPUT_D2_all.[Country of Business Focus], INPUT_D2_all.[Country of SoW], INPUT_D2_all.[Country of Nationality / Citizenship], INPUT_D2_all.[Country of Perm Residence], INPUT_D2_all.[Country of Government], INPUT_D2_all.[Legal Entity Structure], INPUT_D2_all.[Product Risk], INPUT_D2_all.[Trade Flag], INPUT_D2_all.[PCM Flag], INPUT_D2_all.[Safe Deposit Product Flag], INPUT_D2_all.[$ Cash transactions - m1], INPUT_D2_all.[$ Cash transactions - m2], INPUT_D2_all.[$ Cash transactions - m3], INPUT_D2_all.[$ Cash transactions - m4], INPUT_D2_all.[$ Cash transactions - m5], INPUT_D2_all.[$ Cash transactions - m6], INPUT_D2_all.[$ Cash transactions - m7], INPUT_D2_all.[$ Cash transactions - m8], INPUT_D2_all.[$ Cash transactions - m9], INPUT_D2_all.[$ Cash transactions - m10], INPUT_D2_all.[$ Cash transactions - m11], INPUT_D2_all.[$ Cash transactions - m12], INPUT_D2_all.[# Cash transactions - m1], INPUT_D2_all.[# Cash transactions - m2], INPUT_D2_all.[# Cash transactions - m3], INPUT_D2_all.[# Cash transactions - m4], INPUT_D2_all.[# Cash transactions - m5], INPUT_D2_all.[# Cash transactions - m6], INPUT_D2_all.[# Cash transactions - m7], INPUT_D2_all.[# Cash transactions - m8], INPUT_D2_all.[# Cash transactions - m9], INPUT_D2_all.[# Cash transactions - m10], INPUT_D2_all.[# Cash transactions - m11], INPUT_D2_all.[# Cash transactions - m12], INPUT_D2_all.[$ Cross-border wires m1], INPUT_D2_all.[$ Cross-border wires m2], INPUT_D2_all.[$ Cross-border wires m3], INPUT_D2_all.[$ Cross-border wires m4], INPUT_D2_all.[$ Cross-border wires m5], INPUT_D2_all.[$ Cross-border wires m6], INPUT_D2_all.[$ Cross-border wires m7], INPUT_D2_all.[$ Cross-border wires m8], INPUT_D2_all.[$ Cross-border wires m9], INPUT_D2_all.[$ Cross-border wires m10], INPUT_D2_all.[$ Cross-border wires m11], INPUT_D2_all.[$ Cross-border wires m12], INPUT_D2_all.[# Cross-border wires - m1], INPUT_D2_all.[# Cross-border wires - m2], INPUT_D2_all.[# Cross-border wires - m3], INPUT_D2_all.[# Cross-border wires - m4], INPUT_D2_all.[# Cross-border wires - m5], INPUT_D2_all.[# Cross-border wires - m6], INPUT_D2_all.[# Cross-border wires - m7], INPUT_D2_all.[# Cross-border wires - m8], INPUT_D2_all.[# Cross-border wires - m9], INPUT_D2_all.[# Cross-border wires - m10], INPUT_D2_all.[# Cross-border wires - m11], INPUT_D2_all.[# Cross-border wires - m12], INPUT_D2_all.[$ PCM wires - m1], INPUT_D2_all.[$ PCM wires - m2], INPUT_D2_all.[$ PCM wires - m3], INPUT_D2_all.[$ PCM wires - m4], INPUT_D2_all.[$ PCM wires - m5], INPUT_D2_all.[$ PCM wires - m6], INPUT_D2_all.[$ PCM wires - m7], INPUT_D2_all.[$ PCM wires - m8], INPUT_D2_all.[$ PCM wires - m9], INPUT_D2_all.[$ PCM wires - m10], INPUT_D2_all.[$ PCM wires - m11], INPUT_D2_all.[$ PCM wires - m12], INPUT_D2_all.[# PCM wires - m1], INPUT_D2_all.[# PCM wires - m2], INPUT_D2_all.[# PCM wires - m3], INPUT_D2_all.[# PCM wires - m4], INPUT_D2_all.[# PCM wires - m5], INPUT_D2_all.[# PCM wires - m6], INPUT_D2_all.[# PCM wires - m7], INPUT_D2_all.[# PCM wires - m8], INPUT_D2_all.[# PCM wires - m9], INPUT_D2_all.[# PCM wires - m10], INPUT_D2_all.[# PCM wires - m11], INPUT_D2_all.[# PCM wires - m12], INPUT_D2_all.[$ wires to high risk countries m1], INPUT_D2_all.[$ wires to high risk countries m2], INPUT_D2_all.[$ wires to high risk countries m3], INPUT_D2_all.[$ wires to high risk countries m4], INPUT_D2_all.[$ wires to high risk countries m5], INPUT_D2_all.[$ wires to high risk countries m6], INPUT_D2_all.[$ wires to high risk countries m7], INPUT_D2_all.[$ wires to high risk countries m8], INPUT_D2_all.[$ wires to high risk countries m9], INPUT_D2_all.[$ wires to high risk countries m10], INPUT_D2_all.[$ wires to high risk countries m11], INPUT_D2_all.[$ wires to high risk countries m12], INPUT_D2_all.[# wires to high risk countries m1], INPUT_D2_all.[# wires to high risk countries m2], INPUT_D2_all.[# wires to high risk countries m3], INPUT_D2_all.[# wires to high risk countries m4], INPUT_D2_all.[# wires to high risk countries m5], INPUT_D2_all.[# wires to high risk countries m6], INPUT_D2_all.[# wires to high risk countries m7], INPUT_D2_all.[# wires to high risk countries m8], INPUT_D2_all.[# wires to high risk countries m9], INPUT_D2_all.[# wires to high risk countries m10], INPUT_D2_all.[# wires to high risk countries m11], INPUT_D2_all.[# wires to high risk countries m12], INPUT_D2_all.[Turnover (GPB HNAH only)], INPUT_D2_all.[SCC flag], INPUT_D2_all.[SCC reason], INPUT_D2_all.[Previous Risk Rating], INPUT_D2_all.[Previous Country Risk Factor Rating], INPUT_D2_all.[Previous Business Type Risk Factor Rating], INPUT_D2_all.[Previous Legal Entity Risk Factor rating], INPUT_D2_all.[Previous Product Risk Factor Rating], INPUT_D2_all.[Assumption flag], INPUT_D2_all.LOB1, INPUT_D2_all.Country, INPUT_D2_all.[Cash Only], INPUT_D2_all.[Cash/Xborder ], INPUT_D2_all.PRR, Calculation_D2_all.[Overal RAG]
FROM Calculation_D2_all INNER JOIN INPUT_D2_all ON Calculation_D2_all.[Client Type] = INPUT_D2_all.ClientID
WHERE (((INPUT_D2_all.LOB1)="GPB "));
I have SQL code and im trying to join memo fields
Is someone able to add the line of SQL
Where Left([INPUT D2 DATA].[Customer Type], 255) = Left([Calculation D2].[Client Type], 255
Im new to SQL so keep getting the syntax wrong.
Many thanks
SELECT INPUT_D2_all.ID, INPUT_D2_all.ClientID, INPUT_D2_all.[Customer Type Family], INPUT_D2_all.[Customer Type], INPUT_D2_all.LoB, INPUT_D2_all.Segment, INPUT_D2_all.[Business Type], INPUT_D2_all.[Employment Status], INPUT_D2_all.[Key controller flag], INPUT_D2_all.[Country of Incorp/ Registration / Trust Est], INPUT_D2_all.[Country of Primary Operation], INPUT_D2_all.[Country of Business Focus], INPUT_D2_all.[Country of SoW], INPUT_D2_all.[Country of Nationality / Citizenship], INPUT_D2_all.[Country of Perm Residence], INPUT_D2_all.[Country of Government], INPUT_D2_all.[Legal Entity Structure], INPUT_D2_all.[Product Risk], INPUT_D2_all.[Trade Flag], INPUT_D2_all.[PCM Flag], INPUT_D2_all.[Safe Deposit Product Flag], INPUT_D2_all.[$ Cash transactions - m1], INPUT_D2_all.[$ Cash transactions - m2], INPUT_D2_all.[$ Cash transactions - m3], INPUT_D2_all.[$ Cash transactions - m4], INPUT_D2_all.[$ Cash transactions - m5], INPUT_D2_all.[$ Cash transactions - m6], INPUT_D2_all.[$ Cash transactions - m7], INPUT_D2_all.[$ Cash transactions - m8], INPUT_D2_all.[$ Cash transactions - m9], INPUT_D2_all.[$ Cash transactions - m10], INPUT_D2_all.[$ Cash transactions - m11], INPUT_D2_all.[$ Cash transactions - m12], INPUT_D2_all.[# Cash transactions - m1], INPUT_D2_all.[# Cash transactions - m2], INPUT_D2_all.[# Cash transactions - m3], INPUT_D2_all.[# Cash transactions - m4], INPUT_D2_all.[# Cash transactions - m5], INPUT_D2_all.[# Cash transactions - m6], INPUT_D2_all.[# Cash transactions - m7], INPUT_D2_all.[# Cash transactions - m8], INPUT_D2_all.[# Cash transactions - m9], INPUT_D2_all.[# Cash transactions - m10], INPUT_D2_all.[# Cash transactions - m11], INPUT_D2_all.[# Cash transactions - m12], INPUT_D2_all.[$ Cross-border wires m1], INPUT_D2_all.[$ Cross-border wires m2], INPUT_D2_all.[$ Cross-border wires m3], INPUT_D2_all.[$ Cross-border wires m4], INPUT_D2_all.[$ Cross-border wires m5], INPUT_D2_all.[$ Cross-border wires m6], INPUT_D2_all.[$ Cross-border wires m7], INPUT_D2_all.[$ Cross-border wires m8], INPUT_D2_all.[$ Cross-border wires m9], INPUT_D2_all.[$ Cross-border wires m10], INPUT_D2_all.[$ Cross-border wires m11], INPUT_D2_all.[$ Cross-border wires m12], INPUT_D2_all.[# Cross-border wires - m1], INPUT_D2_all.[# Cross-border wires - m2], INPUT_D2_all.[# Cross-border wires - m3], INPUT_D2_all.[# Cross-border wires - m4], INPUT_D2_all.[# Cross-border wires - m5], INPUT_D2_all.[# Cross-border wires - m6], INPUT_D2_all.[# Cross-border wires - m7], INPUT_D2_all.[# Cross-border wires - m8], INPUT_D2_all.[# Cross-border wires - m9], INPUT_D2_all.[# Cross-border wires - m10], INPUT_D2_all.[# Cross-border wires - m11], INPUT_D2_all.[# Cross-border wires - m12], INPUT_D2_all.[$ PCM wires - m1], INPUT_D2_all.[$ PCM wires - m2], INPUT_D2_all.[$ PCM wires - m3], INPUT_D2_all.[$ PCM wires - m4], INPUT_D2_all.[$ PCM wires - m5], INPUT_D2_all.[$ PCM wires - m6], INPUT_D2_all.[$ PCM wires - m7], INPUT_D2_all.[$ PCM wires - m8], INPUT_D2_all.[$ PCM wires - m9], INPUT_D2_all.[$ PCM wires - m10], INPUT_D2_all.[$ PCM wires - m11], INPUT_D2_all.[$ PCM wires - m12], INPUT_D2_all.[# PCM wires - m1], INPUT_D2_all.[# PCM wires - m2], INPUT_D2_all.[# PCM wires - m3], INPUT_D2_all.[# PCM wires - m4], INPUT_D2_all.[# PCM wires - m5], INPUT_D2_all.[# PCM wires - m6], INPUT_D2_all.[# PCM wires - m7], INPUT_D2_all.[# PCM wires - m8], INPUT_D2_all.[# PCM wires - m9], INPUT_D2_all.[# PCM wires - m10], INPUT_D2_all.[# PCM wires - m11], INPUT_D2_all.[# PCM wires - m12], INPUT_D2_all.[$ wires to high risk countries m1], INPUT_D2_all.[$ wires to high risk countries m2], INPUT_D2_all.[$ wires to high risk countries m3], INPUT_D2_all.[$ wires to high risk countries m4], INPUT_D2_all.[$ wires to high risk countries m5], INPUT_D2_all.[$ wires to high risk countries m6], INPUT_D2_all.[$ wires to high risk countries m7], INPUT_D2_all.[$ wires to high risk countries m8], INPUT_D2_all.[$ wires to high risk countries m9], INPUT_D2_all.[$ wires to high risk countries m10], INPUT_D2_all.[$ wires to high risk countries m11], INPUT_D2_all.[$ wires to high risk countries m12], INPUT_D2_all.[# wires to high risk countries m1], INPUT_D2_all.[# wires to high risk countries m2], INPUT_D2_all.[# wires to high risk countries m3], INPUT_D2_all.[# wires to high risk countries m4], INPUT_D2_all.[# wires to high risk countries m5], INPUT_D2_all.[# wires to high risk countries m6], INPUT_D2_all.[# wires to high risk countries m7], INPUT_D2_all.[# wires to high risk countries m8], INPUT_D2_all.[# wires to high risk countries m9], INPUT_D2_all.[# wires to high risk countries m10], INPUT_D2_all.[# wires to high risk countries m11], INPUT_D2_all.[# wires to high risk countries m12], INPUT_D2_all.[Turnover (GPB HNAH only)], INPUT_D2_all.[SCC flag], INPUT_D2_all.[SCC reason], INPUT_D2_all.[Previous Risk Rating], INPUT_D2_all.[Previous Country Risk Factor Rating], INPUT_D2_all.[Previous Business Type Risk Factor Rating], INPUT_D2_all.[Previous Legal Entity Risk Factor rating], INPUT_D2_all.[Previous Product Risk Factor Rating], INPUT_D2_all.[Assumption flag], INPUT_D2_all.LOB1, INPUT_D2_all.Country, INPUT_D2_all.[Cash Only], INPUT_D2_all.[Cash/Xborder
FROM Calculation_D2_all INNER JOIN INPUT_D2_all ON Calculation_D2_all.[Client
WHERE (((INPUT_D2_all.LOB1)="GPB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When i try and change data type, i get the error "Microsoft Access cant change the data type"
There isnt enough disk space or memory
There isnt enough disk space or memory
Have you tried compact/repairing the database?
It is a hack but it works as you can't join memo fields. No repair is needed.
It doesn't matter if a memo holds more than 255 chars but, of course, the first the first 255 chars should be unique if any memo field is considered unique.
/gustav
It doesn't matter if a memo holds more than 255 chars but, of course, the first the first 255 chars should be unique if any memo field is considered unique.
/gustav
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rebuild is needed!
If the field can contain more than 255 characters, you would run into problems with the JOIN if any differences occurred after the first 255 characters,
If the field contains 255 characters or LESS, why not cleanly eliminate the problem by defining it as Text instead of Memo?