I have following SQL query and I want to convert it to LINQ. I want to use a subquery or the LINQ include syntax and don’t want to use join:
SELECT Count(*) AS CountOfRecs
FROM tblAcc a
INNER JOIN tblAccOwner o ON
a.[Creditor Registry ID] = o.[Registry ID] AND
a.[Account No] = a.[Account No]
WHERE
(a.[Account Owner ID] = 731752693037116688) AND
a.[Account Type] NOT IN ('CA00', 'CA01', 'CA03', 'CA04', 'CA02',
'PA00', 'PA01', 'PA02', 'PA03', 'PA04')) AND
(DATEDIFF(mm, a.[State Change Date], GETDATE()) <= 4 OR
a.[State Change Date] IS NULL AND
(a.[Account Type] IN ('OD','CL00','PL00') OR a.[Account Type] LIKE '%hala%'))
You can use LinqPad or Linqer. I would try to convert it in LinqPad, but I would have to have the database.