Skip to content
Advertisement

Access Query to return custom quarters from a date field

If someone could help me out on this problem. This company’s quarter starts as follows where the numbers represent the months and the Q’s are the quarters.

I am trying to make a query a that returns the number 1, 2, 3, 4 for dates that fall within the quarters. I have researched and came across this approach but doesn’t work correctly because I don’t know how to handle Iif and Between functions.

Quarter: Iif(Month([MyDate]) Between 9 And 11, 1, Iif(Month([MyDate]) Between 12 And 2, 2, Iif(Month([MyDate]) Between 3 And 5, 3, 4)))

Advertisement

Answer

A simpler method uses datepart() — but 4 months later:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement