The following works in Access;
SELECT Transactions.Date, Transactions.Time, Transactions.Direction,
Transactions.TransactionNumber, Transactions.TransactionType,
Transactions.Exception, Exceptions.ExceptionType
FROM Transactions LEFT JOIN Exceptions
ON (Transactions.TransactionNumber = Exceptions.TransactionNumber)
AND (Transactions.Date = Exceptions.Date)
AND (Transactions.TokenNumber = Exceptions.TokenNumber)
WHERE (((Transactions.Date)>=20120803)
AND ((Transactions.Direction)=-1)
AND ((Exceptions.ExceptionType) Not In (43,44,45,46)
OR (Exceptions.ExceptionType) Is Null)
AND ((Transactions.TokenNumber)=6605253))
ORDER BY Transactions.Date, Transactions.TransactionNumber;
But when done in ASP as below, I get error '80004005'
SELECT Transactions.Date, Transactions.Time, Transactions.Direction,
Transactions.TransactionNumber, Transactions.TransactionType,
Transactions.Exception, Exceptions.ExceptionType
FROM Transactions LEFT JOIN Exceptions
ON Transactions.TransactionNumber = Exceptions.TransactionNumber
AND Transactions.Date = Exceptions.Date
AND Transactions.TokenNumber = Exceptions.TokenNumber
WHERE Transactions.Direction = -1
AND (Exceptions.ExceptionType Not In (43,44,45,46)
OR Exceptions.ExceptionType Is Null)
AND Transactions.TokenNumber= 6605253
AND Transactions.Date >= 20120803
ORDER BY Transactions.Date, Transactions.TransactionNumber
I removed some of the brackets by the way, thinking it would help, but it did not.