Skip to content
Loading
  
  •         }  
  • is there a better way? 
    +1
  • Marius Vasile
    +1
    I am still not getting the corect results. Either duplicate values or no value at all
     
    1. CraftWorkViews = await (from a in _context.WOMains.Where(s => s.OrgID == orgid)  
    2.  join b in _context.WOPlanners.Where(s => s.Craft == craftid) on a.WOMainID equals b.WOMainID into Temp1  
    3.  from c in Temp1  
    4.  join d in _context.WOPlannerSCHs.Where(s => s.Craft == craftid) on c.WOMainID equals d.WOMainID into Temp2  
    5.  from e in Temp2  
    6.     select new CraftWorkView  
    7.           {  
    8.   
    9.                WOMainID = a.WOMainID,  
    10.                WONumber = c.WONumber,  
    11.                Subsequent = c.WONumberS,  
    12.                Activity = c.Activity,  
    13.                StartDate = e.StartDateP,  
    14.                EndDate = e.DueDateP,  
    15.                CompletionDate = e.CompDateP  
    16.   
    17.   
    18.          }).ToListAsync();  
     bot variables are coorectly defined orgid and craftid
    +1
  • Marius Vasile
    +1
    Thank you Rijwan, I tried that, I get error "cannot convert from DateTime? to DateTime". The table is filled with default(DateTime), sometthing like 1/1/0001 12:00:00 which I will handle in View but the rest of the data is not displayed. It has something to do with the query I guess, because I run through three table maybe?
    +1