Hi,
I have this IF condition statement - for some reason I am getting the Invalid type in operator ==
The field in the database is int and it can have null values
[PolicyResult policyID] - This is int in database and can have null values.. so I tried to use ToString
My output column is String type - still getting this invalid type operator==could someone please help where I am go
IF ToString([PolicyResult policyID])="10102" OR ToString([PolicyResult policyID])="10103" OR ToString([PolicyResult policyID])="10104" THEN "Uptime"
ELSEIF IsNull([PolicyResult policyID]) OR Length(ToString([PolicyResult policyID]))="0" THEN "No Policy ID"
ELSEIF ToString([PolicyResult policyID]) IN (
"10019",
"10247",
"10248",
"10249",
"10250",
"10251",
"10262",
"10264",
"10265",
"10266",
"10284",
"10286",
"10287"
) AND Uppercase([PolicyResult Status])="BREAK" THEN "Other"
ELSE "Policy ID not in the list"
ENDIF
Solved! Go to Solution.
Hi @Raj_007 ,
I think the error comes from the quotation marks around 0
Length function will return you a numeric value, and you are comparing it with a string.
It should be
OR Length(ToString([PolicyResult policyID]))=0
instead.
Give this a try and let me know if that resolved the error.
Cheers,
Angelos
Same conclusion with @AngelosPachis after testing,
The Length function will produce a number, can not be compared with a String.
Thank you Qiu, This is really helpful
Thank you AnelosPachis - This is really helpful - it worked
@Raj_007
Thank you so much for the accept mark.
Just a warm note, multiple accept is allowed here, so you may consider also mark @AngelosPachis answer as accept also?