callydata
Oct 12th, 2005, 03:27 PM
I feel like this code should work! I want this formula to check for the appropriate dates and return the amount associated with it. What am I doing wrong????
This code is in Crystal syntax
//FUture START WITH NO END DATES
If IsNull({ACH.Ending}) And {ACH.Starting} > CurrentDate Then
"$" + {ACH.Amount}
Else If IsNull({ACH.Ending1}) And {ACH.Starting1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If IsNull({ACH.Ending2}) And {ACH.Starting2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If IsNull({ACH.Ending3}) And {ACH.Starting3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If IsNull({ACH.Ending4}) And {ACH.Starting4} > CurrentDate Then
"$" + {ACH.Amount4}
//CuRRENT START WITH NO END DATES
Else If IsNull({ACH.Ending}) And {ACH.Starting} < CurrentDate Then
"$" + {ACH.Amount}
Else If IsNull({ACH.Ending1}) And {ACH.Starting1} < CurrentDate Then
"$" + {ACH.Amount1}
Else If IsNull({ACH.Ending2}) And {ACH.Starting2} < CurrentDate Then
"$" + {ACH.Amount2}
Else If IsNull({ACH.Ending3}) And {ACH.Starting3} < CurrentDate Then
"$" + {ACH.Amount3}
Else If IsNull({ACH.Ending4}) And {ACH.Starting4} < CurrentDate Then
"$" + {ACH.Amount4}
//NORMAL DATES
Else If {ACH.Starting} < CurrentDate And {ACH.Ending} > CurrentDate Then
"$" + {ACH.Amount}
Else If {ACH.Starting1} < CurrentDate And {ACH.Ending1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If {ACH.Starting2} < CurrentDate And {ACH.Ending2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If {ACH.Starting3} < CurrentDate And {ACH.Ending3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If {ACH.Starting4} < CurrentDate And {ACH.Ending4} > CurrentDate Then
"$" + {ACH.Amount4}
//FUTURE DATES
Else If {ACH.Starting} > CurrentDate And {ACH.Ending} > CurrentDate Then
"$" + {ACH.Amount}
Else If {ACH.Starting1} > CurrentDate And {ACH.Ending1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If {ACH.Starting2} > CurrentDate And {ACH.Ending2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If {ACH.Starting3} > CurrentDate And {ACH.Ending3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If {ACH.Starting4} > CurrentDate And {ACH.Ending4} > CurrentDate Then
"$" + {ACH.Amount4}
This code is in Crystal syntax
//FUture START WITH NO END DATES
If IsNull({ACH.Ending}) And {ACH.Starting} > CurrentDate Then
"$" + {ACH.Amount}
Else If IsNull({ACH.Ending1}) And {ACH.Starting1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If IsNull({ACH.Ending2}) And {ACH.Starting2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If IsNull({ACH.Ending3}) And {ACH.Starting3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If IsNull({ACH.Ending4}) And {ACH.Starting4} > CurrentDate Then
"$" + {ACH.Amount4}
//CuRRENT START WITH NO END DATES
Else If IsNull({ACH.Ending}) And {ACH.Starting} < CurrentDate Then
"$" + {ACH.Amount}
Else If IsNull({ACH.Ending1}) And {ACH.Starting1} < CurrentDate Then
"$" + {ACH.Amount1}
Else If IsNull({ACH.Ending2}) And {ACH.Starting2} < CurrentDate Then
"$" + {ACH.Amount2}
Else If IsNull({ACH.Ending3}) And {ACH.Starting3} < CurrentDate Then
"$" + {ACH.Amount3}
Else If IsNull({ACH.Ending4}) And {ACH.Starting4} < CurrentDate Then
"$" + {ACH.Amount4}
//NORMAL DATES
Else If {ACH.Starting} < CurrentDate And {ACH.Ending} > CurrentDate Then
"$" + {ACH.Amount}
Else If {ACH.Starting1} < CurrentDate And {ACH.Ending1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If {ACH.Starting2} < CurrentDate And {ACH.Ending2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If {ACH.Starting3} < CurrentDate And {ACH.Ending3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If {ACH.Starting4} < CurrentDate And {ACH.Ending4} > CurrentDate Then
"$" + {ACH.Amount4}
//FUTURE DATES
Else If {ACH.Starting} > CurrentDate And {ACH.Ending} > CurrentDate Then
"$" + {ACH.Amount}
Else If {ACH.Starting1} > CurrentDate And {ACH.Ending1} > CurrentDate Then
"$" + {ACH.Amount1}
Else If {ACH.Starting2} > CurrentDate And {ACH.Ending2} > CurrentDate Then
"$" + {ACH.Amount2}
Else If {ACH.Starting3} > CurrentDate And {ACH.Ending3} > CurrentDate Then
"$" + {ACH.Amount3}
Else If {ACH.Starting4} > CurrentDate And {ACH.Ending4} > CurrentDate Then
"$" + {ACH.Amount4}