Hi,
I'm using Crystal V10 on Oracle DB
I have added a Select Case statement to the record selection, but its now taking a LOT longer to run.
I had to do a nested Select Case, and I think I've done it wrong.
Can someone have a look at this and tell me how I can fix it?
(SELECT Month(cdate({?Pm-?Period End Date}))
CASE 2 :
SELECT day(cdate({?Pm-?Period End Date}))
CASE 29,30,31 :
SELECT Remainder(Year(cdate({?Pm-?Period End Date}))-1992,4)
CASE 0 :
{CWRCASE.CWRCASE_CLOSING_DATE} <=
date(Year(cdate({?Pm-?Period End Date})),Month(cdate({?Pm-?Period End Date})),29)
DEFAULT:
{CWRCASE.CWRCASE_CLOSING_DATE} <=
date(Year(cdate({?Pm-?Period End Date})),Month(cdate({?Pm-?Period End Date})),28)
DEFAULT: {CWRCASE.CWRCASE_CLOSING_DATE} <= cdate({?Pm-?Period End Date})
DEFAULT: {CWRCASE.CWRCASE_CLOSING_DATE} <= cdate({?Pm-?Period End Date})
)
The reason I had to put this in, was a user sometimes put the End Date parameter as 29 Feb when it wasnt a leap year, so that meant the report changed the 'end date' to be the report run date.
The parameters are string parameters (entered as dd/mm/yy and converted to date using cdate.
The Select Case statement is meant to say, if the month selected is Feb, and the year is not a leap year, do Day = 28 else do Day = 29.
Let me know if you need any other info.
Thanks
regards
BB
*** Count your blessings not your problems******