Hi, I have a large SQL statement that uses 2 variables from an excel worksheet for start_date and end_date
I call the variables in the temp table at the top of the statements and then again in the main statement.
If I leave out the temp table, It works fine but when it is included I get "invalid parameter number" and invalid descriptor index" as errors.
The WHERE of my temp table is as follows:
invoice_booking_detail.customer_group = '12' AND
invoice_booking_remarks.remark_number = 3 AND
invoice_booking_detail.invoice_date BETWEEN ? AND ?)
and in my main statement is:
invoice_booking_detail.invoice_date >= ? AND
invoice_booking_detail.invoice_date <= ? AND
invoice_booking_detail.customer_group = '12'
having never really used temp tables before, I am a little in the dark.
Any suggestions gratefully received.