M
Mark
I am struggling with the referencing a form field's value, within a crosstab query. The SQL is:
TRANSFORM Sum(tbl2.PO_UNIT_PRICE*tbl2.PO_QUANTITY_ORDERED) AS Amount
SELECT "dB" AS Source, Year([PO_NEED_BY_DATE]) AS [Year], tbl3.PO_VENDOR_NAME AS Vendor, tbl2.PO_ITEM_MANUFACTURER AS Manufacturer
FROM tbl1 INNER JOIN (((tbl4 INNER JOIN tbl5 ON tbl4.RQSTN_DIST_ID = tbl5.RQSTN_DIST_ID) INNER JOIN tbl2 ON tbl4.PO_LINE_ID = tbl2.PO_LINE_ID) INNER JOIN tbl3 ON tbl2.PO_HEADER_ID = tbl3.PO_HEADER_ID) ON tbl1.PO_LINE_ID = tbl2.PO_LINE_ID
WHERE (((tbl1.PO_NEED_BY_DATE)>=[Forms]![iFrmRptSel]![txtStart]) AND ((tbl2.PO_CANCEL_FLAG)="N" Or (tbl2.PO_CANCEL_FLAG) Is Null) AND ((tbl3.PO_CANCEL_FLAG)="N" Or (tbl3.PO_CANCEL_FLAG) Is Null)) OR (((tbl2.PO_CANCEL_FLAG)="N" Or (tbl2.PO_CANCEL_FLAG) Is Null) AND ((tbl3.PO_CANCEL_FLAG)="N" Or (tbl3.PO_CANCEL_FLAG) Is Null))
GROUP BY "dB", Year([PO_NEED_BY_DATE]), tbl3.PO_VENDOR_NAME, tbl2.PO_ITEM_MANUFACTURER
PIVOT tbl5.RQSTN_EXPENSE_TYPE;
I get 'The Microsoft Jet database engine does not recognize <name> as a valid field name or expression. (Error 3070)' as the error mssg, with the [Forms]![iFrmRptSel]![txtStart] as the 'name' it is referring to.
Does it think its a parameter? Is there a different syntax I should use?
TRANSFORM Sum(tbl2.PO_UNIT_PRICE*tbl2.PO_QUANTITY_ORDERED) AS Amount
SELECT "dB" AS Source, Year([PO_NEED_BY_DATE]) AS [Year], tbl3.PO_VENDOR_NAME AS Vendor, tbl2.PO_ITEM_MANUFACTURER AS Manufacturer
FROM tbl1 INNER JOIN (((tbl4 INNER JOIN tbl5 ON tbl4.RQSTN_DIST_ID = tbl5.RQSTN_DIST_ID) INNER JOIN tbl2 ON tbl4.PO_LINE_ID = tbl2.PO_LINE_ID) INNER JOIN tbl3 ON tbl2.PO_HEADER_ID = tbl3.PO_HEADER_ID) ON tbl1.PO_LINE_ID = tbl2.PO_LINE_ID
WHERE (((tbl1.PO_NEED_BY_DATE)>=[Forms]![iFrmRptSel]![txtStart]) AND ((tbl2.PO_CANCEL_FLAG)="N" Or (tbl2.PO_CANCEL_FLAG) Is Null) AND ((tbl3.PO_CANCEL_FLAG)="N" Or (tbl3.PO_CANCEL_FLAG) Is Null)) OR (((tbl2.PO_CANCEL_FLAG)="N" Or (tbl2.PO_CANCEL_FLAG) Is Null) AND ((tbl3.PO_CANCEL_FLAG)="N" Or (tbl3.PO_CANCEL_FLAG) Is Null))
GROUP BY "dB", Year([PO_NEED_BY_DATE]), tbl3.PO_VENDOR_NAME, tbl2.PO_ITEM_MANUFACTURER
PIVOT tbl5.RQSTN_EXPENSE_TYPE;
I get 'The Microsoft Jet database engine does not recognize <name> as a valid field name or expression. (Error 3070)' as the error mssg, with the [Forms]![iFrmRptSel]![txtStart] as the 'name' it is referring to.
Does it think its a parameter? Is there a different syntax I should use?