In my report there are two parameters named “C_Month” and “C_Year”, for example we pass “JUL” and “2009” seperately
In the report i have to display a label in the following manner “Current Data of: Jul 31, 2009”
now the problem is, users are able to select the future dates from the application side like “DEC” “2009” from the drop down and if they do so my label will display “Current Data of: DEC 31, 2009”
and the report data will not be of DEC 2009 which will mislead them, so i want to write a formula in Crystal Report, if the users selects the future date lable should display the “Current Data of: Jul 31, 2009” and if the users selects back date like “DEC” “2008” the label should show “Current Data of: Dec 31, 2008”, Please let me know how can i implement it
Display most current date - {@Display Most Current}:
local datevar showdate ;
If {@Get Last Day of Input} > CurrentDate Then showdate := {@Last Day of Current}
Else showdate := {@Get Last Day of Input} ;
"Current Data of: " & showdate ;
Of course, you could handle all that with only long formula, but I did it with four to keep it simple.
Thanks a lot for your reply, I am passing both the Month and Year parameter as string so Is it possible to do it in one formula ? and what changes i need to make kindly let me know ?
Please don’t take this the wrong way, but I have given you more than enough for you to be able to finish. You could easily substitute DATA_DATE for CurrentDate - I do not have to do that for you. For the date format, look up ToText in the CR Help. If you can’t figure it out after looking and trying a few things on your own, I will be happy to help again. It’s better to try and fail than for me to write the end solution for you.
Thanks for your reply, I am just a starter on crystal report, trying to learn so pls. dont mind if i ask you silly questions, i tried replacing the currentdate with DATA_DATE column but still its showing the currentdate and currently i am using your first solution because the single formula was giving me some error