on 02-27-2015 4:23 PM
Can someone advise how I can add the account balance to this query. Thanks Danielle SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardCode]"Customer Code", T0.[CardName], t0.doctotal"Total Payment", T0.[PayNoDoc]"payment on account", isnull(t0.openbal, '0')"Not reconciled", t0.nodocsum"Total before partial reconcile", t0.nodocsum-t0.openbal as 'Reconcile Amount' FROM [dbo].[ORCT] T0 left JOIN RCT2 T1 ON T0.Docnum = T1.DocNum WHERE T0.[PayNoDoc] = 'y' and isnull(t0.openbal,'0') <> '0' and t0.doctype = 'c'
Hi,
Do you mean customer account balance?
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardCode]"Customer Code", T0.[CardName], t0.doctotal"Total Payment", T0.[PayNoDoc]"payment on account", isnull(t0.openbal, '0')"Not reconciled", t0.nodocsum"Total before partial reconcile", t0.nodocsum-t0.openbal as 'Reconcile Amount' ,T2.[Balance]
FROM [dbo].[ORCT] T0 left JOIN RCT2 T1 ON T0.Docnum = T1.DocNum left join OCRD T2 on t2.cardcode = T0.cardcode WHERE T0.[PayNoDoc] = 'y' and isnull(t0.openbal,'0') <> '0' and t0.doctype = 'c'
User | Count |
---|---|
107 | |
12 | |
10 | |
5 | |
5 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.