Data Table query not returning all Records

I have the following query looking at two data tables

(From a In dtUniqueNamesEmails
Group Join b In dtADRecords
On a(“EmailAddress”).ToString Equals b(“EmailAddress”).ToString Into grp = Group
From g In grp.DefaultIfEmpty
Select dtUniqueNamesEmailsAD.Rows.Add({a(“DisplayName”),a(“EmailAddress”),a(“CreatedOn”),a(“LastUpdated”),a(“LastLogin”),If(IsNothing(g),Nothing,g(“SAMAccountName”))})).CopyToDataTable

Regrettably, it does not bring back every record it should and is missing a couple of records from the second table

I have confirmed this by outputting the two data tables to Excel and manually running a VLOOKUP when everything is returned correctly.

Anybody any ideas why it may be missing a couple of records

Thx

hi,

could you log the emails which are not joining could be because of minor case difference which are not big of a concern in vlookup, since vlookup is case insensitive. It would also help you to figure if there is any difference between the values

This is called a join. It’s a standard database operation. Just use the Join Data Table activity - much simpler than this expression.

Thanks; it is case issue; I will try and ensure everyting is in lower case to solve the issue

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.