good day!
I just want to ask if is it possible to have count on dinstint? I have a query below but it produces error in the expression. Im pulling data in MSAccess using ADODB.
SQL = "SELECT" & _
" (SELECT COUNT(DISTINCT DateOInvoice) FROM InvoiceMain AS A WHERE (DateOInvoice>=DateValue('" & StartDate & "') AND DateOInvoice<=DateValue('" & ReportDate & "'))) AS NoofDaysMonth," & _
" (SELECT COUNT(DISTINCT DateOInvoice) FROM InvoiceMain AS B WHERE (DateOInvoice>=DateValue('" & BeginDate & "') AND DateOInvoice<=DateValue('" & ReportDate & "'))) AS NoofDaysYear" & _
" FROM InvoiceMain"
Thank you!