SELECT statement not working in ADO (SQL). Worked fine with DAO (Access)
I recently upgraded an app from using DAO with an Access 97 db to ADO with
SQL 7. This statement is now not working:
SELECT DISTINCTROW Count(*) AS [Count Of tblPurchaseItems],
tblPurchaseItems.ItemID, First(tblPurchaseItems.ItemName) AS FirstOfItemName
FROM tblPurchases INNER JOIN tblPurchaseItems ON tblPurchases.OrderNumber =
tblPurchaseItems.OrderNumber WHERE (((tblPurchases.OrderStatus)="completed"
Or (tblPurchases.OrderStatus)="Completed" Or
(tblPurchases.OrderStatus)="COMPLETED") AND ((tblPurchases.OrderDate)
Between #08/31/2000# And #09/30/2000#)) GROUP BY tblPurchaseItems.ItemID;
There are two tables, tblPurchases and tblPurchaseItems. What I need is a
count of all the items in tblPurchaseItems that have a coresponding order
that matches OrderStatus=Complete and the date period. I hope that makes
Thanks in advace.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL