Hi
I am trying to create a function to compare sales to date in this financial year compared with last financial year.
My function to get this years result is:
Public Function FinYTDCash() As Currency
Dim EndDate As Date
Dim StartDate As Date
Dim ThisYear As Integer
ThisYear = Year(Date)
EndDate = (Date)
StartDate = DateSerial(Year(Date), 7, 1)
FinYTDCash = DSum("[Cash]", "QrySalesFiscalandCal", "[date1] BETWEEN #" & StartDate & "# AND #" & EndDate & "# " And _
"[FY] = '" & ThisYear & "'")
End Function
Each criteria works individually but not when I combine them leading me to think the syntax is wrong.
Any assistance would be greatly appreciated.
Thanks
David