Using MySql
This query is returning items outside the date range specified. I can’t figure out why?
SELECT
tblOrderLines.ProductID,
tblOrderLines.PersonID,
tblOrderLines.OrderID,
tblOrders.OrderDate,
tblOrderLines.ProductDesc,
tblOrderLines.Qty,
tblOrderLines.ItemTotal
FROM
tblOrders
INNER JOIN tblOrderLines ON tblOrders.OrderID = tblOrderLines.OrderID
INNER JOIN tblProducts ON tblOrderLines.ProductID = tblProducts.ProductID
WHERE
((
tblOrders.OrderDate BETWEEN '20103-01-01'
AND '2014-12-31'
)
AND
(CategoryDescription = 'Books'
or CategoryDescription = 'Other'
or CategoryDescription = 'Reports'
or CategoryDescription = 'Actionware'
or CategoryDescription = 'Items'
or CategoryDescription = 'Giftware'
or CategoryDescription = 'Webinars'
or CategoryDescription = 'Education'
or CategoryDescription = 'On Line Course'
)
)
ORDER BY
tblOrders.OrderDate, tblOrderLines.ProductDesc ASC
It’s returning records from 1997, the beginning of the database.
Anybody have a clue?
Thanks
Rich