I am attempting to write a formula that checks if the date in the Oracle record being processed is equal to either the minimum or maximum date in the table. The formula does not contain errors but I cannot create a summary field for the formula. Is my syntax correct?
//Works:
If ({IND_C} = 6.00 and {ACCTG_DATE_D} = Date(2001,1,1))
or ({IND_C} = 12.00 and {ACCTG_DATE_D} = Date(2001,7,1)) Then
{PREV_CNT}
else
0
//Does not Work:
If ({IND_C} = 6.00 and {ACCTG_DATE_D} = (Year(@AcctgMin}), Month({@AcctgMin}), Day({@AcctgMin}))
or ({TERM_IND_C} = 12.00 and {ACCTG_DATE_D} = (Year({@AcctgMax}), Month({@AcctgMax}), Day({@AcctgMax}))) Then
{PREV_CNT}
else
0
@AcctgMin and @AcctgMax are formulas:
@AcctgMin:
dateVar minAcctgMo:= Minimum ({ACCTG_DATE_D});
Date(Year(minAcctgMo), Month(minAcctgMo), Day(minAcctgMo))
@AcctgMax:
dateVar maxAcctgMo:= Maximum ({ACCTG_DATE_D});
Date(Year(maxAcctgMo), Month(maxAcctgMo), Day(maxAcctgMo))
//Works:
If ({IND_C} = 6.00 and {ACCTG_DATE_D} = Date(2001,1,1))
or ({IND_C} = 12.00 and {ACCTG_DATE_D} = Date(2001,7,1)) Then
{PREV_CNT}
else
0
//Does not Work:
If ({IND_C} = 6.00 and {ACCTG_DATE_D} = (Year(@AcctgMin}), Month({@AcctgMin}), Day({@AcctgMin}))
or ({TERM_IND_C} = 12.00 and {ACCTG_DATE_D} = (Year({@AcctgMax}), Month({@AcctgMax}), Day({@AcctgMax}))) Then
{PREV_CNT}
else
0
@AcctgMin and @AcctgMax are formulas:
@AcctgMin:
dateVar minAcctgMo:= Minimum ({ACCTG_DATE_D});
Date(Year(minAcctgMo), Month(minAcctgMo), Day(minAcctgMo))
@AcctgMax:
dateVar maxAcctgMo:= Maximum ({ACCTG_DATE_D});
Date(Year(maxAcctgMo), Month(maxAcctgMo), Day(maxAcctgMo))