The proper syntax in Linq for this SQL query is eluding me. I’d appreciate any hand with this.
SQL:
SELECT TOP 1 posdate
FROM dailypos
GROUP BY posdate
HAVING Count(DISTINCT customernumber) = 3
ORDER BY posdate DESC)
Essentially, I get files from 3 different customers and I need a quick way to determine the most recent date for which I have data from all 3. I’m open to a different approach, but this SQL works for what I need.
I can do the group, but I don’t know how to handle the 4th line (HAVING Count(Distinct…))
Thanks in advance.
Try something like this: