D
Dib
Hi,
I am having a problem with this can some advice me please.
Insert Into #InvcInfo (CustId, RecType, InvcNum, InvcNum1, CheckNum, Charges
, Credits, AmountDue, TransDate, Status, BalDue)
SELECT i.CustId, i.RecType, i.InvcNum,Right(i.InvcNum,9) AS InvcNum1,
i.CheckNum
, Case When i.RecType = 1 Then Amt Else 0 End AS Charges
, Case When i.RecType < 1 Then Amt Else 0 End AS Credits
, Sign(i.RecType) * Amt AS AmountDue
,Case i.Charges - i.Credits AS BalDue -- This is where my problem is I
am creating a field
, i.TransDate, i.Status
FROM dbo.tblArOpenInvoice i (nolock)
WHERE i.CustId Between @CustIDFrom And @CustIDThru
AND i.TransDate <= @CutoffDate AND i.RecType=-2
I am having a problem with this can some advice me please.
Insert Into #InvcInfo (CustId, RecType, InvcNum, InvcNum1, CheckNum, Charges
, Credits, AmountDue, TransDate, Status, BalDue)
SELECT i.CustId, i.RecType, i.InvcNum,Right(i.InvcNum,9) AS InvcNum1,
i.CheckNum
, Case When i.RecType = 1 Then Amt Else 0 End AS Charges
, Case When i.RecType < 1 Then Amt Else 0 End AS Credits
, Sign(i.RecType) * Amt AS AmountDue
,Case i.Charges - i.Credits AS BalDue -- This is where my problem is I
am creating a field
, i.TransDate, i.Status
FROM dbo.tblArOpenInvoice i (nolock)
WHERE i.CustId Between @CustIDFrom And @CustIDThru
AND i.TransDate <= @CutoffDate AND i.RecType=-2