Automate Text/Date Criteria (1 Viewer)

DoneganF

Registered User.
Local time
Today, 06:25
Joined
Aug 7, 2012
Messages
29
I have a data field named “Fiscal Year” which stores values in the following text format; FY 2018. Our fiscal year period is from July thru June – with the YEAR portion of “FY 2018” being the fiscal year ending YEAR. For instance, the date of October 2019 is part of FY 2020. Here’s my problem, I have several queries in which I criteria the Fiscal Year field and I’d like to automate that process, based on the month a user selects. Here is the closest I’ve come thus far:

"FY " & DateSerial(Year(DateAdd("m",+6,([Enter Month]))),6,1)

The problem is that this expression returns “FY 6/1/(appropriate year). I only want it to return “FY (space)” and the appropriate 4-digit year; For instance ...FY 2020

Any help is greatly appreciated!!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:25
Joined
Oct 29, 2018
Messages
21,447
Hi. I'm not sure I follow. So, if the user enters a month number, do we assume the user "always" refers to the upcoming month for the fiscal year? For example, if the user enter the number 7 today, do we return 2020 or 2021?
 

DoneganF

Registered User.
Local time
Today, 06:25
Joined
Aug 7, 2012
Messages
29
No, the user enters a whole date; 6/1/2018 - in which case I need the expression to return "FY 2018"

If the user enters 10/1/2016 the expression needs to return "FY 2017"
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:25
Joined
Oct 29, 2018
Messages
21,447
No, the user enters a whole date; 6/1/2018 - in which case I need the expression to return "FY 2018"

If the user enters 10/1/2016 the expression needs to return "FY 2017"
Okay, in that case, try using this:
Code:
"FY " & Format(DateAdd("m",6,[Enter Date]),"yyyy")
(untested)
Hope it helps...
 

DoneganF

Registered User.
Local time
Today, 06:25
Joined
Aug 7, 2012
Messages
29
Thank you, thank you, thank you! Worked like a charm!:)
 

DoneganF

Registered User.
Local time
Today, 06:25
Joined
Aug 7, 2012
Messages
29
Ok, so one more question. I now need to return the exact same value - but for the previous year?
 

Users who are viewing this thread

Top Bottom