Good day!
I have problems running my union all query..It only executes the first select statement but the 2nd and 3rd union was not executed. My backend DB is MSAccess 2003..
If rs_dailySales.State = adStateOpen Then rs_dailySales.Close
SQL = "SELECT SUM(NetAmount) AS totalCashSales FROM InvoiceMain WHERE InvoiceType='Cash' AND DateOInvoice=DateValue('" & filterdate & "')" & _
" UNION ALL SELECT SUM(NetAmount) AS totalCreditSales FROM InvoiceMain WHERE InvoiceType='Credit' AND DateOInvoice=DateValue('" & filterdate & "')" & _
" UNION ALL SELECT SUM(NetAmount) AS totalDriverSales FROM InvoiceMain WHERE InvoiceType='Driver' AND DateOInvoice=DateValue('" & filterdate & "')"
rs_dailySales.Open SQL, conn, adOpenStatic, adLockOptimistic, adCmdText
I do not know where i miss something..?
Thank you for helping...