Dear All,
I am generating a report based on a table call tblReceipt which have fieilds like outletID, date, totalSales etc. So I am running a report now to get the daily sales for each outlet. So based on a select date I run a for loop date from till date end. So I am running an query like this Select Sum(totalSellingAmount), tblReceipt.outletID From tblReceipt Where tblReceipt.receiptDate = '" + receiptDate + "' And " +
"( " +outletIDString +") Group By tblReceipt.outletID";
The string outletIDString will have an e.g value of outletIDString ="tblReceipt.outletID=4 Or tblReceipt.outletID=5 Or tblReceipt.outletID=6"
I am feeling it is a bit slow can some see how I can improve on this query ? Thank you.
I am generating a report based on a table call tblReceipt which have fieilds like outletID, date, totalSales etc. So I am running a report now to get the daily sales for each outlet. So based on a select date I run a for loop date from till date end. So I am running an query like this Select Sum(totalSellingAmount), tblReceipt.outletID From tblReceipt Where tblReceipt.receiptDate = '" + receiptDate + "' And " +
"( " +outletIDString +") Group By tblReceipt.outletID";
The string outletIDString will have an e.g value of outletIDString ="tblReceipt.outletID=4 Or tblReceipt.outletID=5 Or tblReceipt.outletID=6"
I am feeling it is a bit slow can some see how I can improve on this query ? Thank you.