How about this one:
Getting this Error:sSQL = "" 'This statement is too long and must be split up below ReDim s(1 To 9) s(1) = "SELECT tbl_ALLStatus.Status, Sum(Data.PBO) AS SumOfPBO," s(2) = " Sum([PBO]/[ABI]) AS Borrs, Sum([PBO])/Sum([pbo]/[abi]) AS Borr_ABI, Count(Data.BorrowerUniqueID) AS Loans," s(3) = " tbl_ALLStatus.StatusOrder, Sum(IIf([LoanTypeName]='Consolidation,[PBO],0)) AS Cons_PBO," s(4) = " Sum(IIf([LoanTypeName]<>'Consolidation',[PBO],0)) AS NonCons_PBO" s(5) = "FROM ((Data LEFT JOIN tbl_ALLStatus ON Data.Status = tbl_ALLStatus.Status) LEFT JOIN tbl_ABI" s(6) = " ON Data.BorrowerUniqueID = tbl_ABI.BorrowerUniqueID) LEFT JOIN tbl_ALLLoanTypes ON (Data.LoanType = tbl_ALLLoanTypes.LoanType) AND (Data.LoanProgram = tbl_ALLLoanTypes.LoanProgram)" s(7) = "WHERE (((Data.PBO)<>0))" s(8) = "GROUP BY tbl_ALLStatus.Status, tbl_ALLStatus.StatusOrder" s(9) = "ORDER BY tbl_ALLStatus.StatusOrder;" sSQL = Join(s(), vbCrLf) 'This statement will display qry_Report3
Syntax...
It's large so I put it in the attachment
I really need to figure out how this delimiter works because I have to do 10 of these and I'm only on #3.




Reply With Quote