View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Therezee Therezee is offline
external usenet poster
 
Posts: 3
Default 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?