Can Excel run this?
I just need to know if it's possible because it either returns an error in Select statment syntax or returns zero.SELECT Sum(Data.PBO) AS SumOfPBO, Sum(Data.AccruedInterest) AS SumOfAccruedInterest, Sum(IIf([Status]="Claims" Or [Status]="Forbearance",[AccruedInterest],IIf([Status]="Repayment",0,IIf([SubsidyIndicator]="N",[AccruedInterest],0)))) AS ITBC, Sum(IIf([ABI]=0,0,[pbo]/[ABI])) AS Borr, Count(Data.BorrowerUniqueID) AS Loans, Sum([PBO]*[RemainingRepaymentTerm])/Sum([PBO]) AS RepayTerm, Sum([pbo]*[InterestRate])/Sum([PBO]) AS IntRate FROM Data LEFT JOIN tbl_ABI ON Data.BorrowerUniqueID = tbl_ABI.BorrowerUniqueID HAVING (((Data.PBO)<>0));
I'm using this:
Cross-thread: http://www.excelfox.com/forum/f2/can...1417/#post6658Set cn = New ADODB.Connection With cn .Provider = "Microsoft.ACE.OLEDB.12.0" .Open MyConn Set rs = .Execute(sSQL) End With




Reply With Quote