Hassle-free live chat software re-imagined for business growth. 2 users, always free.
UPDATE dbo.ConsultantPayWhenPaidReport SET ciConsultantReceipts = ISNULL(tcdConsultantReceipts,0) ,ciConsultantReceivableBalance = ISNULL(tcdConsultantReceivableBalance,0) ,prjConsultantWriteoff = ISNULL(ConsultantWriteoff,0) ,rReceiptDate = ISNULL(rDate,NULL) ,TotalPaidByClient =ISNULL(CASE WHEN rDate IS NOT NULL THEN viInvoiceAmount END,0) FROM dbo.ConsultantPayWhenPaidReport LEFT JOIN ( SELECT dbo.AxTransaction.tClientInvoice, dbo.AxReceipt.rDate, SUM(CASE WHEN rType = 0 AND gldType IN (8, 13) THEN - gldAmount END) AS tcdConsultantReceipts, SUM(dbo.AxGLDetail.gldAmount) AS tcdConsultantReceivableBalance, - SUM(CASE WHEN rType = 2 THEN gldAmount END) AS ConsultantWriteoff FROM dbo.AxTransaction LEFT OUTER JOIN dbo.AxGLDetail ON dbo.AxGLDetail.gldTransaction = dbo.AxTransaction.tKey LEFT OUTER JOIN dbo.AxReceipt ON dbo.AxGLDetail.gldReceipt = dbo.AxReceipt.rKey WHERE (dbo.AxTransaction.tActivityType = 3) AND (dbo.AxGLDetail.gldControlAccountType = 2) GROUP BY dbo.AxTransaction.tClientInvoice, dbo.AxReceipt.rDate )SUB ON SUB.tClientInvoice = ciKey
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!