tags:

views:

28

answers:

1

Please, help me. How i can translate this SQL query to LINQ request?

SELECT TOP (1) PERCENT DATEDIFF(DAY, dbo.PO.ORDER_DATE, GETDATE()) AS Age
                FROM dbo.ITEMS INNER JOIN
                                      dbo.X_PO ON dbo.ITEMS.ITEMNO = dbo.X_PO.ITEM_CODE INNER JOIN
                                      dbo.PO ON dbo.X_PO.ORDER_NO = dbo.PO.DOC_NO AND dbo.X_PO.STATUS = dbo.PO.STATUS
                WHERE     (dbo.ITEMS.ITEMNO = 'MBIN001') AND (dbo.X_PO.STATUS = 3)
                ORDER BY Age
A: 

If some here create this for you, who is going to create your second one ?

I suggest start from this examples, and little by little you find the way.

http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx

Aristos