Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If,Then,Else formula

Status
Not open for further replies.

smores1

Technical User
Jan 5, 2011
2
US
I am trying to place the formula below into a Crystal XI report. When I go to save, I receive the message that the remaining text does not appear to be part of the formula. My cursor is moved down to the else section. Any suggestions on how to fix this? Thanks!

If
{ttisfc001100.t_cmdt} = cdatetime(1970, 01, 01, 00, 00, 00)
then
Local DateTimeVar d1 := {ttisfc001100.t_dldt};
Local DateTimeVar d3 := currentdate;
DateDiff ("d",d1,d3) -
DateDiff("ww",d1,d3,crSaturday) -
DateDiff("ww",d1,d3,crSunday)

else

if {ttisfc001100.t_cmdt} <> cdatetime (1970, 01, 01, 00, 00, 00)
then
Local DateTimeVar d1 := {ttisfc001100.t_dldt};
Local DateTimeVar d2 := {ttisfc001100.t_cmdt};
DateDiff ("d",d1,d2) -
DateDiff("ww",d1,d2,crSaturday) -
DateDiff("ww",d1,d2,crSunday)
 
Never mind... Got it. Needed parenthesis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top