I'm trying to imitate:
DB1 AS A LEFT OUTER JOIN
DB2 AS B
ON A.[Currency Code] = B.[Currency Code]
AND A.[Document Date] >= B.[Starting Date]
AND A.[Document Date] <= B.[Ending Date]
This is what I have now:
from ledgers in ledgerEntries
join currency in currencyExchange
on ledgers.CurrencyCode equals currency.CurrencyCode
into c
from currencies in c.DefaultIfEmpty()
where
ledgers.DocumentDate >= currencies.StartingDate
&& ledgers.DocumentDate <= currencies.EndingDate
I've read about creating an anonymous type and setting them equal to each other, but this doesn't work when using less than and greater than for comparing the dates.