Hi
I am attempting to apply a conditional style to a report i have. My issue is i am attempting to take into account a date/time output and a text output in order for it to place a style requested. But i keep getting a parsing error and it is now driving me crazy as i can not see where this could be.
Any help will be appreciated!!! expression used below: -
cast([Query1].[Time Difference from when Documents received], integer) > ('0000-00-0T4:00:00.000000000')) AND [Query1].[Patient Communication Category Description] = ('Registration') OR
cast([Query1].[Time Difference from when Documents received],integer) > ('0000-00-0T24:00:00.000000000') AND [Query1].[Patient Communication Coded Description] = ('Nurse Training Visit')
the error code is: - RSV-VAL-0034 Failed to validate the variable Conditional Style 1. CRX-YXX-4010 A parsing error was found at or near the position 69 in the expression "cast([Query1].[Time Difference from when Documents received], integer) > ('0000-00-0T4:00:00.000000000')) AND [Query1].[Patient Communication Category Description] = ('Registration') OR
cast([Query1].[Time Difference from when Documents received],integer) > ('0000-00-0T24:00:00.000000000') AND [Query1].[Patient Communication Category Description] =('Service Arranged') "..
Looks like you have an additional ) before AND in your first condition.
Sent from my ZUK Z2132 using Tapatalk
Quote from: Kiran P on 29 Aug 2017 05:47:21 AM
Looks like you have an additional ) before AND in your first condition.
Sent from my ZUK Z2132 using Tapatalk
i have removed this but still getting error. same position of error too :S
Quote from: imzy66 on 29 Aug 2017 06:11:10 AM
i have removed this but still getting error. same position of error too :S
Can you do the cast as a query calculation without getting a parsing error? You should eliminate that as a problem first.
Next, it looks like you are comparing an integer value (the result of your cast) with a string representation of a timestamp. What does your field called [Time Difference from when Documents received] contain and what does it look like after you cast it as an integer? If you get a value from the cast on a particular row of, let's say 5, then how does this expression make any sense?
5 > ('0000-00-0T4:00:00.000000000')
Perhaps your expression should just be this:
cast([Query1].[Time Difference from when Documents received], integer) > 0
which would resolve to:
5 > 0
You'll need to determine that your cast expression is valid first, then figure out what the value is you really want to compare with (not a string) and then build up your condition from there.
Report Expressions use a different function set, which actually doesn't have the cast function. Try string2double().
Also, when using an OR make sure you wrap both predicates in parens.
(a=b AND c=d) OR (a>b AND c<d)
Thanks Paul. This worked for me. :)