I am writing a query in LINQ and I am stuck with the subquery part.
SELECT account, bal_date, ccy, balance
FROM Balance A
A.balance < 0 AND
A.date = ( SELECT
FROM Balance B
WHERE balance < 0 AND
A.account = B.account AND
A.ccy = B.ccy
Dim query = From bal In dt.AsEnumerable() _
Where bal.Item("balance") < 0 _
And bal.Item(“bal_date”) = ( subquery? )
I learned that if I do Grouping by account and currency, I can get the MIN (bal_date), but the I need the balance of such date, not the MIN(balance) or MAX(balance).
I would appreciate if I get some help from Experts...