I'm a using crystal reports 2008 & oracle 10g.
I'm grouping the report where the data from 2 different tables has to be displayed under the respective groups based on the logic.
Here's the formula
if ((DateAdd('d',30,{table1.APPDATE1}) < currentdate) or ({table2.DUEDATE2} <1 currentdate)) then "OverDue"
else if ( ( DateAdd('d',30,{table1.APPDATE1}) > currentdate and month(cdate(DateAdd('d',30,{table1.APPDATE1}))) = month(currentdate) )
or
( month(cdate({table2.DUEDATE2})) =month(currentdate) or month(cdate({table2.DUEDATE2})) > month(dateadd('m',1,currentdate)) )
) then "Due This Month"
else if ( ( DateAdd('d',30,{table1.APPDATE1}) > currentdate and month(cdate(DateAdd('d',30,{table1.APPDATE1}))) > month(currentdate) )
or
(month(cdate({table2.DUEDATE2})) > month(dateadd('m',2,currentdate))
) then "Due Next Month"
else "None"
The formula fails at the first 'OR' condition(only the if ((DateAdd('d',30,{table1.APPDATE1}) < currentdate) ).It displays the records under the 'over due' section and the rest of the records under a blank section(not even 'NONE' section).
I'm grouping the report where the data from 2 different tables has to be displayed under the respective groups based on the logic.
Here's the formula
if ((DateAdd('d',30,{table1.APPDATE1}) < currentdate) or ({table2.DUEDATE2} <1 currentdate)) then "OverDue"
else if ( ( DateAdd('d',30,{table1.APPDATE1}) > currentdate and month(cdate(DateAdd('d',30,{table1.APPDATE1}))) = month(currentdate) )
or
( month(cdate({table2.DUEDATE2})) =month(currentdate) or month(cdate({table2.DUEDATE2})) > month(dateadd('m',1,currentdate)) )
) then "Due This Month"
else if ( ( DateAdd('d',30,{table1.APPDATE1}) > currentdate and month(cdate(DateAdd('d',30,{table1.APPDATE1}))) > month(currentdate) )
or
(month(cdate({table2.DUEDATE2})) > month(dateadd('m',2,currentdate))
) then "Due Next Month"
else "None"
The formula fails at the first 'OR' condition(only the if ((DateAdd('d',30,{table1.APPDATE1}) < currentdate) ).It displays the records under the 'over due' section and the rest of the records under a blank section(not even 'NONE' section).