How do I get the individual values from the following LINQ query? (I want to get the value for DecalExpireDate, DecalExpireMonth, and DecalExpireYear.)
var previousExpirationDate = (from d in db.CT_Decals
where d.TankID == decal.TankID
&& d.DecalStatus == "Approved"
select new
{
d.DecalExpireDate,
d.DecalExpireMonth,
d.DecalExpireYear
}).Max(d => d.DecalExpireDate);
I assume you want to get the
DecalExpireDate,DecalExpireMonth, andDecalExpireYearfrom the element with the highest (last)DecalExpireDate. Then you could order by this date: