S
Steven
What is wrong with this statement?
Note: CurrentBatch is a variable that will be a table. ex: CurrentBatch =
Batch01
strSQL = "SELECT ChartOfAccounts.Active, Co.Status, Dept.Status, " &
CurrentBatch & ".* " + _
"FROM ((Co INNER JOIN " & CurrentBatch & " ON Co.Co = " & CurrentBatch &
".Co) INNER JOIN ChartOfAccounts ON " & CurrentBatch & ".Co =
ChartOfAccounts.Co AND Left(" & CurrentBatch & ".Account,6) =
ChartOfAccounts.Account) INNER JOIN Dept ON Right(" & CurrentBatch &
".Account,4) = Dept.DeptNum " + _
"WHERE (((ChartOfAccounts.Active)=0)) OR (((Co.Status)=0)) OR
(((Dept.Status)=0))"
I know I do not have the stucture correct INNER JOIN and then bringing in
another table to continue more INNER JOINS but I do not know how to correct
it.
Thank you,
Steven
Note: CurrentBatch is a variable that will be a table. ex: CurrentBatch =
Batch01
strSQL = "SELECT ChartOfAccounts.Active, Co.Status, Dept.Status, " &
CurrentBatch & ".* " + _
"FROM ((Co INNER JOIN " & CurrentBatch & " ON Co.Co = " & CurrentBatch &
".Co) INNER JOIN ChartOfAccounts ON " & CurrentBatch & ".Co =
ChartOfAccounts.Co AND Left(" & CurrentBatch & ".Account,6) =
ChartOfAccounts.Account) INNER JOIN Dept ON Right(" & CurrentBatch &
".Account,4) = Dept.DeptNum " + _
"WHERE (((ChartOfAccounts.Active)=0)) OR (((Co.Status)=0)) OR
(((Dept.Status)=0))"
I know I do not have the stucture correct INNER JOIN and then bringing in
another table to continue more INNER JOINS but I do not know how to correct
it.
Thank you,
Steven