I'm trying to write a query in VBA to sum and count salaries and persons based on dates on a form. But I keep getting SYNTAX ERROR. Could someone please help me write this in the correct form it should be.
Here is my code:
Here is my code:
Code:
Set rstOutGoingMin = "Select AllNames, Sum(Salary) As TotalSalary, Count(AllNames) As TotalCount From REVENUE " _
& "Where StartDate >= '" & [Forms]![frmRevenue]![txtBegin] & "' " And StartDate <= '" & [Forms]![frmRevenue]![txtEnd] & "'" & "GROUP BY AllNames ; "