0

I'm using this code (which uses a function to get the balance for a case). However, it keeps telling me that 'Balance' is an invalid column name where I have 'and Balance <> '0.00''. Why?

    SELECT DISTINCT cc.CaseDisplayNumber as [Case Number]
                  , Cactus.JCCactus.fnGetFinancialBalance(fp.financialpartyid) as Balance
    FROM financial.Receipts fr
    inner join financial.FinancialParty fp
        on fr.FinancialPartyID = fp.FinancialPartyID
    inner join dbo.CactusCase cc 
        on fp.CactusCaseID = cc.CactusCaseID
    Where cc.CaseStatusID = 2 --2 = Closed
      and Balance <> '0.00'
    ORDER BY [Case Number]

Thank you.

I'm not sure what alias I should be using for 'Balance'. Why doesn't it like the column name from my SELECT statement?

0 Answers0