Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum with Parameters in a Subquery
I posted this once already, but I think there was just too much in the
question, so I'm rewording it =P When I use my query to get data from specific cells (using parameters) and put it into a subquery, I get a "Type mismatch" error: INNER JOIN (SELECT INVOICE.DATE_FLD, X_INVOIC.ITEM_CODE AS [ITEMSUM], sum(X_INVOIC.QTY_SHIP) AS [Invoice_Sum] FROM X_INVOIC INNER JOIN INVOICES ON (X_INVOIC.ORDER_NO = INVOICES.DOC_NO) WHERE (INVOICES.DATE_FLD BETWEEN '" & cellValue1 & "' AND '" & cellValue2 & "' ) GROUP BY X_INVOIC.ITEM_CODE) InvoiceItemSum ON ITEMS.ITEMNO = InvoiceItemSum.ITEMSUM But when I use the parameter by itself it runs just fine: WHERE (PO.DATE_FLD BETWEEN '" & cellValue1 & "' AND '" & cellValue2 & "' ) Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003, Microsoft Query - reference to subquery alias | Excel Discussion (Misc queries) | |||
Subquery after Left Join | Excel Programming | |||
Too few parameters | Excel Programming | |||
Subquery | Excel Worksheet Functions |