S
SAC
Access 2003
I'm off by a penny. Debit and Credit rows in the table are currency, 2
decimals. Here's the query:
SELECT tblARINH.Custkey,
tblARINH.Date AS TransDate,
tblARINH.Key AS TransKey,
tblARINH.InvNo AS [Number],
tblARINH.ChkNo,
tblARINH.Desc,
tblARINH.Debit,
tblARINH.Credit,
====> Round(DSum("Debit","tblARINH","CustKey=" & [CustKey] & "And [Date]<=#"
& [Transdate] & "# "),2) AS RunDeposit,
====> IIf(IsNull(DSum("Credit","tblArinh","CustKey=" & [CustKey] & "And
[Date]<=#" & [Transdate] & "# ")),0,
====> Round(DSum("Credit","tblArinh","CustKey=" & [CustKey] & "And
[Date]<=#" & [Transdate] & "# "),2)) AS RunPayments,
====> [RunDeposit]-[RunPayments] AS Balance
FROM tblARINH
ORDER BY tblARINH.Custkey, tblARINH.Date, tblARINH.Key;
Any idea for a fix for this?
Thanks for your help!
I'm off by a penny. Debit and Credit rows in the table are currency, 2
decimals. Here's the query:
SELECT tblARINH.Custkey,
tblARINH.Date AS TransDate,
tblARINH.Key AS TransKey,
tblARINH.InvNo AS [Number],
tblARINH.ChkNo,
tblARINH.Desc,
tblARINH.Debit,
tblARINH.Credit,
====> Round(DSum("Debit","tblARINH","CustKey=" & [CustKey] & "And [Date]<=#"
& [Transdate] & "# "),2) AS RunDeposit,
====> IIf(IsNull(DSum("Credit","tblArinh","CustKey=" & [CustKey] & "And
[Date]<=#" & [Transdate] & "# ")),0,
====> Round(DSum("Credit","tblArinh","CustKey=" & [CustKey] & "And
[Date]<=#" & [Transdate] & "# "),2)) AS RunPayments,
====> [RunDeposit]-[RunPayments] AS Balance
FROM tblARINH
ORDER BY tblARINH.Custkey, tblARINH.Date, tblARINH.Key;
Any idea for a fix for this?
Thanks for your help!