I am trying to create an Aggregate Query in VB.Net using LINQ. Basically, I have a list of Claims, with many adjustments mixed in. I am trying to return all the unique members who have had adjustments (what makes a member unique is GroupID, SubgroupID, SSN). Even though these members may have a number of adjustments, I only want each GroupID, SubgroupID, SSN combination listed once.
I am quite versed in SQL, but fairly new to LINQ. In SQL, the query would look something like this:
I am struggling a bit in finding the correct syntax for LINQ, specifically the "Grouping" part. Here is an attempt I had made (based on some code I found on the net), but it obviously only is considering the SSN field, and not the other two fields I need.
Dim results = From p In PreImportData.AsEnumerable
Where Right(p.Field(Of String)("ClaimAdjustSeqNum"), 2) <> "00"
Select p.Field(Of String)("SSN").Distinct()
Can anyone help me get the correct LINQ syntax?