I have four tables, and each table has a date column in it. I am trying to get MAX date of these four date columns.
DateTime maxDate = ((from stockIn in db.StockIns select stockIn.StockInDate)
.Union(from stockOut in db.StockOuts select stockOut.StockOutDate)
.Union(from stockC in db.StockClearances select stockC.StockClearanceDate)
.Union(from stockR in db.StockRejections select stockR.StockRejectionDate))
.Max().Value;
Is this the simplest way ?
Thanks in advance
If that’s the way your data is stored, that’s pretty much as simple as it gets.