Hi,
I'm using this query on my aplication to retrive a recordset that shows
transactions between two date.
The problem is that it's too much slow.
I'm using python and the field TransactionDate is Datetime (e.g.
2008-01-01) and i passed some such parameters
('1', datetime.date(2008, 7, 1), datetime.date(2008, 7, 31))
the query look on 16750 record on tblTansactions and return 85 rows
sSQL ="""SELECT
tblProducts.ProductName,tblProducts.WarehouseCode,tblProducts.UnitsInStock,SUM(tblTransactions.Quantity)
FROM tblProducts
INNER JOIN tblTransactions ON
tblProducts.ProductID=tblTransactions.ProductID
WHERE tblTransactions.TransactionType = 0
AND tblProducts.WarehouseID = ?
AND tblTransactions.TransactionDate BETWEEN ? AND ?
GROUP BY tblProducts.ProductID
ORDER BY tblProducts.ProductName"""
How could improve my code?
regards
Giuseppe
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users