>>Run without parameters (with hardcoded values) to make sure it works without parameters. It still looks like a bug or something gone wrong.
>
>I agree. Later in the program this queries works fine.
>There is something going on the the Where OR clause that must be the issue
>
> lcSQLCMD=[select ljob, matno, unitcost, burden, uomcost, uom, matquant, spoiled];
> +[ FROM bbmatdc ];
> +[ WHERE bbmatdc.ljob=?lcljob ];
> +[ AND bbmatdc.costdate between ?ldstartdate and ?ldenddate]
Can you explain the purpose of that query? May be you can re-think it and do without OR? Alternatively, you can re-write it using UNION instead of OR.
If it's not broken, fix it until it is.
My Blog