Page 1 of 1

Put fiscal year date in a report title

Posted: Thu Jul 09, 2020 7:45 pm
by John Dykema
PC+ v 11, Windows 10
I know this cannot be hard but the Syntax monster keeps beating me up.
I'm trying to put 2020-2021 in the title of a couple reports.
I get as far as entering YEAR(DATE()) in and yes that gives me 2020, no problem.
I cannot get the '-' and the rest in without an error.
I try YEAR(DATE()) "-" YEAR(DATE())+1 but no go.
I'll use these reports year after year in the future, too.
I have the Custom Reports Tutorial Workbook and have searched but cannot find it. Please advise.
Also could you point out where in the book I can find similar statements?
Thanks, John

Re: Put fiscal year date in a report title

Posted: Thu Jul 09, 2020 10:38 pm
by NeilZ
John Dykema wrote:
Thu Jul 09, 2020 7:45 pm
PC+ v 11, Windows 10
I know this cannot be hard but the Syntax monster keeps beating me up.
I'm trying to put 2020-2021 in the title of a couple reports.
I get as far as entering YEAR(DATE()) in and yes that gives me 2020, no problem.
I cannot get the '-' and the rest in without an error.
I try YEAR(DATE()) "-" YEAR(DATE())+1 but no go.
I'll use these reports year after year in the future, too.
I have the Custom Reports Tutorial Workbook and have searched but cannot find it. Please advise.
Also could you point out where in the book I can find similar statements?
Thanks, John
Did you try this?

YEAR(DATE()) "-" (YEAR(DATE())+1)

Re: Put fiscal year date in a report title

Posted: Fri Jul 10, 2020 1:33 pm
by John Dykema
Neil, thanks for the quick return.
I copied your code and still get a Syntax error. Sorry.
Maybe I'll have to just type in the years I want for in the title. I think I did one like that years ago but will have to relearn how to except text that I can put into the title.
John

Re: Put fiscal year date in a report title

Posted: Fri Jul 10, 2020 1:41 pm
by NeilZ
John Dykema wrote:
Fri Jul 10, 2020 1:33 pm
Neil, thanks for the quick return.
I copied your code and still get a Syntax error. Sorry.
Maybe I'll have to just type in the years I want for in the title. I think I did one like that years ago but will have to relearn how to except text that I can put into the title.
John

Sorry John ... it was worth a shot ... however, I just looked at what I put there. Try adding another set of parenthesis like this:

((YEAR(DATE())) + 1 )

Not sure if that would work or not, but it adds another set of parentheses which 'should' allow the function to return a result, then add 1.

Re: Put fiscal year date in a report title

Posted: Fri Jul 10, 2020 2:31 pm
by Zorak
This is tested and will work. Once you get the syntax worked out, it doesn't like appending numbers and strings together, you get an Operator/Operand Type Mismatch error, so you have to convert (TRANSFORM) the numbers to strings.

Code: Select all

TRANSFORM(YEAR(DATE()))+" - "+TRANSFORM(YEAR(DATE())+1)

Re: Put fiscal year date in a report title

Posted: Fri Jul 10, 2020 4:30 pm
by John Dykema
Neil's second formula works and returns "2021" but putting the 2020 formula in does not fly.
Zorak's Transfomer works :) . Thanks. much, John.

Re: Put fiscal year date in a report title

Posted: Fri Jul 10, 2020 6:12 pm
by NeilZ
John Dykema wrote:
Fri Jul 10, 2020 4:30 pm
Neil's second formula works and returns "2021" but putting the 2020 formula in does not fly.
Zorak's Transfomer works :) . Thanks. much, John.
Transformers .. I could make a joke here :)