Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SELECT [t1].[TimelineEndDate], [t0].[DateRecieved], [t2].[ConceptName],[t4].MaxTimeLimit
FROM [QualityAssuranceTesting] AS [t0]
LEFT JOIN [ImplementationTimeline] AS [t1] ON [t0].[RequestId] = [t1].[RequestId]
LEFT JOIN [PIP_Concept] AS [t2] ON [t0].[RequestId] = [t2].[RequestId]
LEFT JOIN [ActionHistoryInfo] AS [t3] ON [t2].[RequestId] = [t3].[RequestId]
LEFT JOIN [SlaCategory] AS [t4] ON [t4].SlaLevel = 'Implementation'
Left JOIN [ActionHistoryInfo] AS [t5] ON [t5].ActionTimeStamp BETWEEN '2017-11-06' AND '2017-09-06'


What I have tried:

C#
from q in QualityAssuranceTestings 
join i in ImplementationTimelines
.where(imple=>imple.RequestId == p.RequestId).DefaultIfEmpty()
join c in PIP_Concepts
.where(concept=>concept.RequestId == i.RequestId).DefaultIfEmpty()
join a in ActionHistoryInfo
.where(action=>action.RequestId == i.RequestId).DefaultIfEmpty()
join s in SlaCategories.where(x=>x.Slalevel == "Implementation") into 
where a.ActionTimeStamp <=new DateTime(2017,09,06) && a.ActionTimeStamp>= new DateTime(2017,11,06)
select new
{
i.TimelineEndDate,
q.DateRecieved,
c.ConceptName,
}
Posted
Updated 14-Nov-17 12:30pm
v2

1 solution

Not a real answer but... there is a tool called Linqer[^] which can convert from SQL to Linq - you can get a trial which will get you out of your immediate problem.

I have found Linq to be very frustrating at times, some SQL functions such as DateDiff are just not supported or extremely problematic to implement. When I run into these issues in MVC is revert to straight SQL - refer Entity Framework Raw SQL Queries[^]

Kind Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900