Can anybody help me turn a query expression into a function?
I have been using an expression to calculate dates based on the sytem date CODE: Between IIf(Format(Date(),"mmdd")>"0831",DateSerial(Year(Date()),9,1),DateSerial(Year(Date())-1,9,1)) And Date() Which returns sets of dates from the first of September of a year through to next September of the following year depending on which side of the year you run it to give me a Season of one year that is current according to the system date. I hope this makes sense! I want to be able to set the year to 1st September as the start date of the first part of the current year up to next september 1st when the year start will increment by 1. The join date for members will fall into the Season according to the year regardless of exactly what the date is as long as it is within the 365 days of the year start date. E.g.
If members join 9th September 2005 or January 21st 2006 the Season will be the same for them both i.e. Season 2005-06. Then Sept 1st 2006 becomes Season 2006-07 etc for all members registering within this period. I want to turn it into a function so that I can use it in reports and forms without having to manually change the year or season because it will automatically update according to the system date. Is this feasible or possible -it's beyond my limited ability!
I have been using an expression to calculate dates based on the sytem date CODE: Between IIf(Format(Date(),"mmdd")>"0831",DateSerial(Year(Date()),9,1),DateSerial(Year(Date())-1,9,1)) And Date() Which returns sets of dates from the first of September of a year through to next September of the following year depending on which side of the year you run it to give me a Season of one year that is current according to the system date. I hope this makes sense! I want to be able to set the year to 1st September as the start date of the first part of the current year up to next september 1st when the year start will increment by 1. The join date for members will fall into the Season according to the year regardless of exactly what the date is as long as it is within the 365 days of the year start date. E.g.
If members join 9th September 2005 or January 21st 2006 the Season will be the same for them both i.e. Season 2005-06. Then Sept 1st 2006 becomes Season 2006-07 etc for all members registering within this period. I want to turn it into a function so that I can use it in reports and forms without having to manually change the year or season because it will automatically update according to the system date. Is this feasible or possible -it's beyond my limited ability!