Gerhardpet
asked on
Crystal report formula not working
I have one report where the following formula is not working. I did not design this reports and as far as I know the report should run and look for last months sales history data. Also I'm pretty sure this report worked in 2013 so it may be that the formula does not work in 2014 because of it set to look at last months data.
Here is the error I get
UPPERCASE(MONTHNAME(MONTH(CurrentDate)-1,FALSE))+" "+
TOTEXT(IF MONTH(CurrentDate)=1 THEN YEAR(CurrentDate)-1 ELSE YEAR(CurrentDate),0,"")
Here is the error I get
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
IF MONTH(CurrentDate)=1
THEN UPPERCASE(MONTHNAME(12),FALSE))
ELSE UPPERCASE(MONTHNAME(MONTH(CurrentDate)-1,FALSE)) + " " +
I think you want to make a minor adjustment to Technodweeb's recommendation.
The issue is that the previous month concept of subtracting 1 works great until the you hit January as 1 - 1 = 0. I hard coded the value for December in the true part of the If statement.
Yes, you are correct...
ASKER
@ButlerTechnology
You formula does it only replace the first line or the whole formula I have?
You formula does it only replace the first line or the whole formula I have?
Replaces only the first line...
as you have done
Remove the last ")" on the 3rd line
as you have done
Remove the last ")" on the 3rd line
ASKER
@Technodweeb
That did not work.
@pcelba
your formula works. Thanks!
That did not work.
@pcelba
your formula works. Thanks!
Replace line 1 with this and see what happens:
Open in new window