I get an error when the equal sign is not recognized. I always check my code in Access to make sure it will work. Does anyone know why this is happening?
Code:
SELECT SUM( IIf(TransactionType = 'Cash', TotalPrice, 0) ) AS TotalCash, SUM( IIf(TransactionType = 'Credit', TotalPrice, 0) ) AS TotalCredit, SUM( IIf(TransactionType = 'Check', TotalPrice, 0) ) AS TotalCheck, SUM( IIf(TransactionType = 'Multiple', IIf(MultiCash = 0, 0, MultiCash), 0) ) AS MultipleCash, SUM( IIf(TransactionType = 'Multiple', IIf(MultiCredit= 0, 0, MultiCredit), 0) ) AS MultipleCredit, SUM( IIf(TransactionType = 'Multiple', IIf(MultiCheck = 0, 0, MultiCheck), 0) ) AS MultipleCheck FROM RECEIPT WHERE ReceiptDate BETWEEN ? AND ?
Error:
Generated SELECT statement. Error in list of function arguments: '=' not recongized. Unable to parse query text.
EDIT:
Let me tell you what I want to do, not just send the code. This may be another simple solution to this problem. Therefore, I want to withdraw the report from the report viewer in vb.net to tell me the tender that was used between specific dates.
Ex.
1/20/2013 Transaction Type Amount Cash $100.00 Check $300.00 Credit $1,000.00 MultiCash $1,500.00 MultiCheck $1,500.00 MultiCredit $1,500.00
Something like this in a report viewer. The user will be able to select specific dates. The My Access database table for retrieving information from is shown below.
RECEIPT ----------- ReceiptNumber (PK) ReceiptDate TotalPrice TransactionType MultiCash MultiCheck MultiCredit TotalTax
Any other ways to do this, maybe?
Thanks for the help.