|
-
Dec 14th, 2006, 07:25 AM
#1
Thread Starter
Lively Member
[RESOLVED] Whats the problem with this expression?
i am using VBnet 2002 and crystal v9.1
Please I am trying to define an expression in my crystal report but still having errors , Can you help me please???
below is my code,please advice accordingly ;
VB Code:
Local StringVar message := "";
Local Datevar confdate ={pensioners.date_conf_pens_terms};
Local Datevar hiredate ={pensioners.hiredate};
if hiredate = confdate then
message="N/A"
ELSE
confdate
I simply want to display a message "N/A" on the report when dates are equal and confdate when otherwise.
Please help.
-
Dec 14th, 2006, 11:28 AM
#2
Re: Whats the problem with this expression?
What are the error messages?
You need to use := when assigning values to variables.
Based on the IF statement the Formula returns either a string or a date. This is not allowed. A formula can only return 1 datatype.
-
Dec 15th, 2006, 01:11 AM
#3
Thread Starter
Lively Member
Re: Whats the problem with this expression?
Thanks for the message.I have tried to make some changes to my code as you suggested but still am having an error message"The remaining text doesnt appear to be part of the formula" it highlights almost the whole code.below is the code
VB Code:
Local StringVar message := "";
Local Datevar confdate :=cstr{pensioners.date_conf_pens_terms};
Local Datevar hiredate :=cstr{pensioners.hiredate};
if hiredate = confdate then
message="N/A"
ELSE
confdate
-
Dec 15th, 2006, 11:06 AM
#4
Re: Whats the problem with this expression?
try
message := "N/A"
but do you even need the local variables
Code:
If {pensioners.hiredate} = {pensioners.date_conf_pens_terms} Then
"N/A"
Else
ToText({pensioners.date_conf_pens_terms})
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|