I was given a SQL statement from my DBA to use within my application. I'm not sure how to convert it to code that LLBL can use. Here is my SQL statement.
(reformatted -- daelmo)
SELECT *
FROM CrewEmpInfo C
WHERE 0 =
(
SELECT Count(*)
FROM CrewAssign A
WHERE
C.NTAN8 = A.NTAN8
AND( (StartDate BETWEEN A.StartDate ANDA.EndDate
OR EndDate BETWEEN A.StartDate and A.EndDate
OR (StartDate < A.StartDate ANDEndDate > A.EndDate)
)
)
AND BusinessUnit = C.BusinessUnit
)
ORDER BY SeniorityDate
I tried to write the statement but it seems that Linq doesn't like the between keyword.
Here is what I tried:
(reformatted -- daelmo)
Dim col =
From e In metaData.CrewEmployeeInfo
Where 0 = ( From a In metaData.CrewAssignment
Where e.Ntan8 = a.Ntan8
And ( (startDate >= a.StartDate And startDate <= a.EstimatedEndDate)
Or (endDate >= a.StartDate And endDate <= a.EstimatedEndDate)
Or (startDate < a.StartDate And endDate > a.EstimatedEndDate)
)
Order By e.SeniorityDate And BusinessUnit = C.BusinessUnit
)
Select count(*)
Select e
Is there another way of doing this?
PS... I'm using SelfServicing.