Convert SQL Statement to Linq

Hi,

I’m currently struggling converting a select statement with multiple join to linq.

SELECT [Tbl_A155 LT Concat].Client, [Tbl_A155 LT Concat].Application, [Tbl_A155 LT
Concat].[Condition type], [Tbl_A155 LT Concat].[Sales Org#], [Tbl_A155 LT Concat].[Distr#
Channel], [Tbl_A155 LT Concat].[Price List], [Tbl_A155 LT Concat].Article, [Tbl_A155 LT
Concat].[Sales unit], [Tbl_A155 LT Concat].[Concat PP], [Tbl_A155 LT Concat].[Valid to],
[Tbl_A155 LT Concat].[Valid From], [Tbl_A155 LT Concat].[Cond#record no#], [Tbl_A155 LT
Concat].[Concat PL], [Tbl_A155 LT Concat].[LT VKP0], [Tbl_A155 LT Concat].[LT Unit], [LT
VKP0]/[LT Unit] AS [LT Unit Price], [Tbl_A755 ZEDL Concat].[Valid to] AS [ZEDL Valid To],
[Tbl_A755 ZEDL Concat].[Valid From] AS [ZEDL Valid From], [Tbl_A755 ZEDL Concat].ZEDL,
[Tbl_A755 ZEDL Concat].[ZEDL per], [ZEDL]/[ZEDL per] AS [ZEDL Unit Price], [Tbl_A155 ST
Concat].[Valid to] AS [ST Valid To], [Tbl_A155 ST Concat].[Valid From] AS [ST Valid From],
[Tbl_A155 ST Concat].[ST VKP0], [Tbl_A155 ST Concat].[ST Unit], [ST VKP0]/[ST Unit] AS [ST
Unit Price], [Tbl_PP Concat].[P Rt Amt] AS [PP Retail], [Tbl_PP Concat].[P Rt Per] AS [PP Unit],
[P Rt Amt]/[P Rt Per] AS [PP Unit Price], [Tbl_PP Concat].[Rt UOM] AS [PP UOM], [Tbl_PP
Concat].Ct, [Tbl_PP Concat].[Site Grp], [Tbl_PP Concat].Status, [Tbl_PP Concat].[Cp Tp] INTO
[Tbl_All Price updated]
FROM (([Tbl_A155 ST Concat] RIGHT JOIN [Tbl_A155 LT Concat] ON [Tbl_A155 ST
Concat].[Concat PL] = [Tbl_A155 LT Concat].[Concat PL]) LEFT JOIN [Tbl_A755 ZEDL Concat]
ON [Tbl_A155 LT Concat].[Concat PL] = [Tbl_A755 ZEDL Concat].[Concat PL]) LEFT JOIN
[Tbl_PP Concat] ON [Tbl_A155 LT Concat].[Concat PP] = [Tbl_PP Concat].[Concat PP]
ORDER BY [Tbl_PP Concat].Status;

I have already the three datatables for that, and need a linq query that will have the same output in SQL above.

You may try to model your case in LinqPad
https://www.linqpad.net/

Cheers

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.