Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Year (YYYY) or Next Year (YYYY) 1

Status
Not open for further replies.

Hillary

Programmer
Feb 15, 2002
377
US
I have a field on my report for year. The year runs July 1 through June 30. I want to test the date before printing the year. What is the best way to do this?

If Current Date is January 1 through June 30 (inclusive) then print Current Year (YYYY) 2004 else If Current Date is July 1 through December 31 then print Next Year (YYYY) 2005

Thanks,

Hillary
 
Try:

if month({currentdate}) in 1 to 6 then year(currentdate) else
if month(currentdate) in 7 to 12 then year(currentdate)+1

Usually if I'm working with fiscal year, I'll make a fiscal year parameter and then do selection formulas like:

{table.date} in date({?fiscalyear}-1,07,01) to
date({?fiscalyear}, 06, 30)

Not sure how you want to use the year formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top