I am using a variable to get the year - DateSerial(Year(date),1,1) gives me 1/1/2019. However, I am using this for a parameter for a query and I need to use 2019 for 4/1/2019 - 3/31/2020. So I need an if statement that will use the previous year if it is in Jan, Feb, Mar
like
Dim QCurrentMonth as Integer
QCurrentMonth = Month (Date())
If QCurrentMonth >0 and < 4 Then
QCurrentMonth =DateSerial(Year(date)-1,3,31)
Else
QCurrentMonth = DateSerial(Year(date),3,31)
End If
However, I can't even test if it works because the Month(Date()) does not work (i tried in the immediate window) and in the vba editor it also does not like - If QCurrentMonth >0 and < 4 Then
I need some help with getting the current month as a number
I need some help with getting the if statement to determine if it is a 1,2 0r 3
Thanks