ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pivot table Commandtext causes runtime error 1004 in excel 2000 (https://www.excelbanter.com/excel-programming/358659-pivot-table-commandtext-causes-runtime-error-1004-excel-2000-a.html)

Therezee

pivot table Commandtext causes runtime error 1004 in excel 2000
 
Please help...

I have this code running fine under Excel2003...

ActiveWorkbook.PivotCaches(2).CommandText = _
"SELECT BKS.BKS_BookAmt, BKS.BKS_BookDate, BKS.BKS_SalesOrderID,
BKS.BKS_TerritoryCodes, IMA.IMA_ItemName, 'CAT
'+substring(IMA.IMA_Classification,1,1) AS 'CATEGORY' FROM {oj IERP60.dbo.BKS
BKS LEFT OUTER JOIN IERP60.dbo.IMA IMA ON BKS.BKS_ItemID = IMA.IMA_ItemID}
WHERE (BKS.BKS_BookDate Between '" & strDateFrom & "' And '" & strDateTo &
"')"

* i have intentionally remove some of the selected fields to shorten the
query here...

But when i ran esame code using Excel2000 on a different machine, i got the
run tim error 1004 - Application Defined or Object Defined Error

err.raise gave me an Argument not Optional error

Can anybody please help me out with this one?


All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com