DECLARE @items table (
pfid varchar(8),
timestart datetime,
timeend datetime
)
insert INTO @items(pfid,timestart,timeend)
VALUES('123456','12:00 AM','3:00 AM')
,('987654', '2:00 AM', '4:00 PM')
,('492384', '3:00 PM', '9:00 PM')
SELECT * FROM @items a
INNER JOIN @items b
ON a.timestart < b.timeend
AND b.timestart < a.timeend
AND a.pfid != b.pfid
I need the select statement above converted to LINQ. In my code, I am working with a DataTable, named 'dt'. My table has three columns just like in the example above, exact same names and populated with this data.
I am struggling to create a LINQ query that will query my DataTable in the same fashion my SQL query is working with the temp table above. Please assist. Thanks in advance!