I'm creating an app in Visual Studio 2008 Standard and I'm trying to create a query with a subquery for an MS Access database (.accdb). I'm getting the error 'Syntax Error in From Clause'. Please see my code below. Would appreciate any help. Thanks!
Dim cmdLoanerTransactions As New OleDbCommand("SELECT tblLoaners.Loaner, tblLoaners.Code, tblLoaners.Model," & _
" tblTransactions.CheckedOutTo, tblTransactions.DueDate," & _
" tblTransactions.Comments, tblTransactions.Analyst" & _
" FROM tblLoaners LEFT JOIN (SELECT CheckedOutTo, DueDate, Comments, Analyst" & _
" FROM tblTransactions ON tblLoaners.ID = tblTransactions.Loaner (WHERE CheckedInDate IS NULL))" & _
" WHERE Active = 'Active'", conn)
Dim cmdLoanerTransactions As New OleDbCommand("SELECT tblLoaners.Loaner, tblLoaners.Code, tblLoaners.Model," & _
" tblTransactions.CheckedOutTo, tblTransactions.DueDate," & _
" tblTransactions.Comments, tblTransactions.Analyst" & _
" FROM tblLoaners LEFT JOIN (SELECT CheckedOutTo, DueDate, Comments, Analyst" & _
" FROM tblTransactions ON tblLoaners.ID = tblTransactions.Loaner (WHERE CheckedInDate IS NULL))" & _
" WHERE Active = 'Active'", conn)