C
Crispywafers
Hi,
Quick question. I have been trying and trying to get this to work--
but obviously nested "WHERE"'s do not work. How would this statement
be translated into SQL? (Using it in an append query)
Only select Orders from the Orders Table where Orders.SchoolYear =
[Specific School Year] and Student_Records.Active = True and
Orders.OrderID is not equal to Invoices.OrderID were Invoices.TriID =
"J"
TRIED:
PARAMETERS [Specify School Year] DateTime;
INSERT INTO [Invoices] (OrderID, TriAmountDue)
SELECT Orders.OrderID, Orders.JulyTuition
FROM Student_Records INNER JOIN (Orders LEFT JOIN [Invoices] ON
Orders.OrderID=[Invoices].OrderID) ON
Student_Records.StudentID=Orders.StudentID
WHERE(((Exists (SELECT * FROM Orders WHERE Orders.SchoolYear =
[Specify School Year] AND ((Student_Records.Active) = True) AND
Orders.OrderID <> Invoices.Order ID WHERE Invoices.TriID = "J"));
Quick question. I have been trying and trying to get this to work--
but obviously nested "WHERE"'s do not work. How would this statement
be translated into SQL? (Using it in an append query)
Only select Orders from the Orders Table where Orders.SchoolYear =
[Specific School Year] and Student_Records.Active = True and
Orders.OrderID is not equal to Invoices.OrderID were Invoices.TriID =
"J"
TRIED:
PARAMETERS [Specify School Year] DateTime;
INSERT INTO [Invoices] (OrderID, TriAmountDue)
SELECT Orders.OrderID, Orders.JulyTuition
FROM Student_Records INNER JOIN (Orders LEFT JOIN [Invoices] ON
Orders.OrderID=[Invoices].OrderID) ON
Student_Records.StudentID=Orders.StudentID
WHERE(((Exists (SELECT * FROM Orders WHERE Orders.SchoolYear =
[Specify School Year] AND ((Student_Records.Active) = True) AND
Orders.OrderID <> Invoices.Order ID WHERE Invoices.TriID = "J"));