Hi all.
I am running SX.e 5.6.063 with country pack 1.4.063, on version 9.1e (please, no flames about the version!). I am trying to do a query via VBA for MS Access 2000. This query works:
As soon as I add the following, I get a syntax error
AND oeeh.invoicedt = [HASHTAG]#01[/HASHTAG] May 2014#
~~ OR ~~
AND oeeh.invoicedt = #01/05/14#
Can anyone suggest what to do about it? I have tryied some bracketting options, such as
I am running SX.e 5.6.063 with country pack 1.4.063, on version 9.1e (please, no flames about the version!). I am trying to do a query via VBA for MS Access 2000. This query works:
SELECT oeeh.orderno AS orderno, oeeh.ordersuf AS ordersuf, oeeh.transtype AS transtype, oeel.shipprod AS shipprod, oeel.restockamt AS restockamt, oeel.restockfl AS restockfl, oeel.qtyship AS qtyship, IFNULL(icss.csunperstk,1) AS csunperstk, oeel.netamt AS netamt, oeel.prodcost AS linecost, IFNULL(pder.rebateamt,0) AS rebateamt
FROM pub.oeeh AS oeeh
LEFT JOIN pub.oeel AS oeel
ON oeeh.cono = oeel.cono AND oeeh.orderno = oeel.orderno AND oeeh.ordersuf = oeel.ordersuf
LEFT OUTER JOIN pub.pder AS pder
ON oeel.cono = pder.cono AND oeel.orderno = pder.orderno AND oeel.ordersuf = pder.ordersuf AND oeel.lineno = pder.lineno
LEFT JOIN pub.icss AS icss
ON oeel.cono = icss.cono AND oeel.shipprod = icss.prod AND oeel.icspecrecno = icss.icspecrecno
WHERE oeeh.cono = 1 AND oeel.qtyship > 0 AND oeel.specnstype<>'l' AND oeel.shipprod='CBL16242YGR100' AND oeel.netamt <> 0
FROM pub.oeeh AS oeeh
LEFT JOIN pub.oeel AS oeel
ON oeeh.cono = oeel.cono AND oeeh.orderno = oeel.orderno AND oeeh.ordersuf = oeel.ordersuf
LEFT OUTER JOIN pub.pder AS pder
ON oeel.cono = pder.cono AND oeel.orderno = pder.orderno AND oeel.ordersuf = pder.ordersuf AND oeel.lineno = pder.lineno
LEFT JOIN pub.icss AS icss
ON oeel.cono = icss.cono AND oeel.shipprod = icss.prod AND oeel.icspecrecno = icss.icspecrecno
WHERE oeeh.cono = 1 AND oeel.qtyship > 0 AND oeel.specnstype<>'l' AND oeel.shipprod='CBL16242YGR100' AND oeel.netamt <> 0
As soon as I add the following, I get a syntax error
AND oeeh.invoicedt = [HASHTAG]#01[/HASHTAG] May 2014#
~~ OR ~~
AND oeeh.invoicedt = #01/05/14#
SELECT oeeh.orderno AS orderno, oeeh.ordersuf AS ordersuf, oeeh.transtype AS transtype, oeel.shipprod AS shipprod, oeel.restockamt AS restockamt, oeel.restockfl AS restockfl, oeel.qtyship AS qtyship, IFNULL(icss.csunperstk,1) AS csunperstk, oeel.netamt AS netamt, oeel.prodcost AS linecost, IFNULL(pder.rebateamt,0) AS rebateamt
FROM (((pub.oeeh AS oeeh
LEFT JOIN pub.oeel AS oeel
ON oeeh.cono = oeel.cono AND oeeh.orderno = oeel.orderno AND oeeh.ordersuf = oeel.ordersuf)
LEFT OUTER JOIN pub.pder AS pder
ON oeel.cono = pder.cono AND oeel.orderno = pder.orderno AND oeel.ordersuf = pder.ordersuf AND oeel.lineno = pder.lineno)
LEFT JOIN pub.icss AS icss
ON oeel.cono = icss.cono AND oeel.shipprod = icss.prod AND oeel.icspecrecno = icss.icspecrecno)
WHERE oeeh.cono = 1 AND oeel.qtyship > 0 AND oeel.specnstype<>'l' AND oeel.shipprod='CBL16242YGR100' AND oeel.netamt <> 0 AND oeeh.invoicedt = [HASHTAG]#01[/HASHTAG] May 2014#
FROM (((pub.oeeh AS oeeh
LEFT JOIN pub.oeel AS oeel
ON oeeh.cono = oeel.cono AND oeeh.orderno = oeel.orderno AND oeeh.ordersuf = oeel.ordersuf)
LEFT OUTER JOIN pub.pder AS pder
ON oeel.cono = pder.cono AND oeel.orderno = pder.orderno AND oeel.ordersuf = pder.ordersuf AND oeel.lineno = pder.lineno)
LEFT JOIN pub.icss AS icss
ON oeel.cono = icss.cono AND oeel.shipprod = icss.prod AND oeel.icspecrecno = icss.icspecrecno)
WHERE oeeh.cono = 1 AND oeel.qtyship > 0 AND oeel.specnstype<>'l' AND oeel.shipprod='CBL16242YGR100' AND oeel.netamt <> 0 AND oeeh.invoicedt = [HASHTAG]#01[/HASHTAG] May 2014#
Last edited by a moderator: