Rob_Radley
Registered User.
- Local time
- Today, 03:04
- Joined
- Jun 6, 2008
- Messages
- 12
Hi, I'm new to crystal reports and I am having trouble with a if then statement. here is what I am entering
if ({SUMPNPOD.ODSDAT} = 0) then ({SUMPNPOD.ODSDAT}) else stringvar x := totext({SUMPNPOD.ODSDAT},"000000");date(2000 + val(right(x,2)),val(left(x,2)),val(mid(x,3,2)))
Crystal is telling me I have an error and that a "number is required here" (Here being after the else).
What I have is a file date field in mmddyy format. The formula after the else works to convert to crystal date format. However if the field is =0 the formula breaks. So I am trying to tell it that if the date field =0 then print the 0, otherwise convert the field value to a crystal date.
Any ideas?
Thanks
if ({SUMPNPOD.ODSDAT} = 0) then ({SUMPNPOD.ODSDAT}) else stringvar x := totext({SUMPNPOD.ODSDAT},"000000");date(2000 + val(right(x,2)),val(left(x,2)),val(mid(x,3,2)))
Crystal is telling me I have an error and that a "number is required here" (Here being after the else).
What I have is a file date field in mmddyy format. The formula after the else works to convert to crystal date format. However if the field is =0 the formula breaks. So I am trying to tell it that if the date field =0 then print the 0, otherwise convert the field value to a crystal date.
Any ideas?
Thanks