I am trying to pass a variable to a sql script and run in using c#.
I get an error saying
"missing expression".
fromDate and toDate are passed as 'dd//mm//yy format. Am i not passing the parametres coorectly using OracleCommand ?
public void TransactionReport(string fromDate, string toDate)
{
string query = "select s.store_code,count(i.invc_sid) as count from invoice_v i Left join store_v s ON i.sbs_no = s.sbs_no and i.store_no = s.store_no Where(i.created_date between to_date(@fromDate,'MM//DD//YY') and to_date(@toDate,'MM//DD//YY')) and i.proc_status not in ('131072','65536','147456', '81920') and i.invc_type = 0 AND i.sbs_no = 6 GROUP BY s.store_code";
conn.Open();
using (OracleCommand cmd = new OracleCommand(query, conn))
{
cmd.Parameters.Add(new OracleParameter("fromDate", fromDate));
cmd.Parameters.Add(new OracleParameter("toDate", toDate));
OracleDataReader dr = cmd.ExecuteReader();