View Full Version : Year Range


aziz rasul
06-19-2009, 01:41 AM
I have a table which contains a field called [DISCHARGE_DATE]. In a select query, I want to create a new field (call it YearRange and must be in format YYYY/YY) which gives me a year range where the change of year range revolves around #01/04/2???# i.e. the first of April each year.

For example:-

DISCHARGE_DATE YearRange
21/02/2009 2008/09
21/04/2009 2009/10
03/03/2011 2010/11
05/11/2011 2011/12

etc.

What should I place in the new field to obtain this?

namliam
06-19-2009, 01:55 AM
How about something with changing the date back to a regular date?
I.e. Change Apr 1 back to Jan 1 to get back to "normal" quarters??

Something like so:
format(dateadd("M",-3,#01-apr-2009#), "YYYY/MM")

DCrake
06-19-2009, 02:16 AM
Is sounds like you are talking about financial/fiscal year There are samples of that here on the forum.

David