Trying to query Pervasive 9 (accpac5.5) with the following query I built in access (which is linked to accpac pervasive tables):
The SQL works great in access but crashes when I try to use in VBA excel.
I know that VBA/excel does NOT like the "[]"...can anyone help me get this SQl to excecute through Excel ?
Code:
SELECT ICITMV.VENDNUM, ICITMV.VENDNAME, ICILOC.ITEMNO, ICILOC.QTYONHAND, ICILOC.QTYONORDER, ICILOC.QTYSALORDR, ICILOC.QTYONHAND-ICILOC.QTYSALORDR AS NET_AVAIL, NET_AVAIL/(ICSTATI.SALESQTY/365*30) AS ['MONTHS LEFT'], ICSTATI.SALESQTY, ICSTATI.SALESQTY/365 AS DDD
FROM ICSTATI INNER JOIN (ICILOC INNER JOIN ICITMV ON ICILOC.ITEMNO = ICITMV.ITEMNO) ON ICSTATI.ITEMNO = ICITMV.ITEMNO
WHERE (((ICITMV.VENDNUM)='22280') AND ((ICSTATI.YEAR)='2008') AND ((ICSTATI.PERIOD)=10));
The SQL works great in access but crashes when I try to use in VBA excel.
I know that VBA/excel does NOT like the "[]"...can anyone help me get this SQl to excecute through Excel ?