
Originally Posted by
Kenneth Hobs
The second would poke the first Join() string from array one int
I'm not sure what you mean by that. I'm sure I'm way off here, but what about this:
'So big it needs a two parter
Dim twoparter As String
ReDim s(1 To 9)
s(1) = "SELECT tbl_ALLStatus.Status,"
s(2) = " Sum(Data.PBO) As SumOfPBO,"
s(3) = " Sum([PBO]/[ABI]) As Borrs,"
s(4) = " Sum([PBO])/Sum([pbo]/[abi]) As Borr_ABI,"
s(5) = " Count(Data.BorrowerUniqueID) As Loans, tbl_ALLStatus.StatusOrder,"
s(6) = " Sum(IIf([LoanTypeName]='Consolidation',"
s(7) = "[PBO],0)) As Cons_PBO,"
s(8) = " Sum(IIf([LoanTypeName]<>'Consolidation',"
s(9) = "[PBO],0)) As NonCons_PBO "
twoparter = Join(s(), ",")
ReDim s(1 To 5)
s(1) = "FROM ((Data LEFT JOIN tbl_ALLStatus ON Data.Status = tbl_ALLStatus.Status)"
s(2) = "LEFT JOIN tbl_ABI ON Data.BorrowerUniqueID = tbl_ABI.BorrowerUniqueID) "
s(3) = "LEFT JOIN tbl_ALLLoanTypes ON (Data.LoanType = tbl_ALLLoanTypes.LoanType)"
s(4) = " And (Data.LoanProgram = tbl_ALLLoanTypes.LoanProgram) "
s(5) = "WHERE (((Data.PBO)<>0));"
twoparter = twoparter + Join(t(), vbCrLf)
sSQL = twoparter
'This statement will display qry_Report3