David Smith

David Smith

  • NA
  • 2k
  • 0

SQL access fiscal where clause query

Sep 2 2012 4:50 AM

Can some  write the logic below in a simpler way Using Access SQL query

    If Month(Now()) < 7 Then
        TempYear = Year(Now()) - 1
    Else
        TempYear = Year(Now())
    End If
    FiscalYearStart = "7/1/" & TempYear
    FiscalYearEnd = "6/30/" & (TempYear + 1)
    StrFilter = StrFilter & "ServiceDateStart >= #" & FiscalYearStart & "# AND ServiceDateStart <= #" & FiscalYearEnd & "#"