hokiewalrus
Registered User.
- Local time
- Today, 10:32
- Joined
- Jan 19, 2009
- Messages
- 50
This is (for me) a fairly complicated SQL statement and it has a problem that I can't track down. Access, however, only gives me the generic "Too few parameters (expected=1)" error.
What I know: StartDate, EndDate, and Blank are all variables being passed to the function and they are all correct. I just need all the posted transactions within the given date range where the payment type is what I've specified.
Thanks in advance
Code:
PaymentSource = "SELECT [tTransPayments].[PaymentAmount] FROM [tTransPayments] " & _
"INNER JOIN [tTransHeader] ON [tTransHeader].[TransactionNumber] = [tTransPayments].[TransactionNumber] " & _
"WHERE ([tTransHeader].[TransactionDate] BETWEEN #" & StartDate & "# AND #" & EndDate & "#) " & _
"AND ([tTransPayments].[PaymentType] = " & Blank & ") " & _
"AND ([tTransHeader].[TransactionStatus] = 'Posted');"
Set Payments = dbs.OpenRecordset(PaymentSource)
What I know: StartDate, EndDate, and Blank are all variables being passed to the function and they are all correct. I just need all the posted transactions within the given date range where the payment type is what I've specified.
Thanks in advance