jemmy parker

jemmy parker

  • NA
  • 18
  • 1.8k

C#

Mar 16 2015 8:43 AM
select distinct InvoiceId,Id.ProjectCode,(select top 1 ClientRefNo from tblOrderDetail where ProjectCode = projectcode) as ClientRefNo,dbo.fnGetCustomerNameWithCode(Customer) as CustomerName,Isnull(SI.Status,'Open') as Status,CS3Invoice,Id.InvoiceDate,
(select CreatedDate from Tt_UploadDocuments where OrderNo = od.OrderNo and UploadDocumentTypeID=44) as PODUploadDate,(select CreatedDate from Tt_UploadDocuments where OrderNo = od.OrderNo and UploadDocumentTypeID=45) as HaulierInvoiceUploadDate,od.OrderNo,PODApprovedDate,Id.FinReconDatePaid as DatePaid
from dbo.InvoiceDetail Id Left join tblOrderDetail od on Id.ProjectCode = od.ProjectCode
inner join TrackingSystemTest.dbo.tblUser U on U.intUserId=OD.CreatedBy
left join Mt_SupplierInvoiceStatus SI on Id.FinReconSupplierInvoiceStatusId = SI.SupplierInvoiceStatusId
Where U.AreaId='ARE159' AND Id.ProjectCode IS NOT NULL AND OD.BaseOrder='B' AND Id.IsSupplierInvoice = 1
Order by Id.InvoiceDate DESC
 
 
I want the above query in LinQ format. Could you please help me? 

Answers (1)