I'm using Crystal Reports XI and connecting to a SQL Server database via OLE DB (ADO).
I have a table which contains lab results. The field, ValueText, has the datatype of ntext with a precision of 16.
Sample data:
As you can tell there is no rhyme or reason to what an individual can input into this field. For the specific test results I'm looking for, the values could be simple numbers (entered as text) or >200.
These are the formulas that I started with. It worked a few times and now I get an error. There is no error message, when I refresh the report it just takes me to the Formula Workshop and highlights one formula.
@Convert Test Results
I then convert the values to numbers for calculation purposes.
@Convert to Number
Then I determine whether the test results are in the range that I need
@In Therapy Range
When the report errors out, in the Formula Workshop it opens {@In Therapy Range}, highlights the first {@Convert to Number}.
I don't know where I've gone wrong or if I am trying to accomplish something that Crystal Reports will not allow me to do.
I only have view access to the database so I cannot create Views or Stored Procedures. I attempted to use a SQL Expressions Field but I received the same error response.
%Convert Test Results
I would appreciate any help or suggestions.
I have a table which contains lab results. The field, ValueText, has the datatype of ntext with a precision of 16.
Sample data:
Code:
<0.3
73
9.2
NO INTERPRETATION
Pending
138
4.4
87
40
15
126
16
0.9
8.5
>200
21KH75915
AMENDED ON 07/15 AT 0614: PREVIOUSLY REPORTED<20 CK </= 20
As you can tell there is no rhyme or reason to what an individual can input into this field. For the specific test results I'm looking for, the values could be simple numbers (entered as text) or >200.
These are the formulas that I started with. It worked a few times and now I get an error. There is no error message, when I refresh the report it just takes me to the Formula Workshop and highlights one formula.
@Convert Test Results
Code:
Left({CDRObservation.ValueText},4)
I then convert the values to numbers for calculation purposes.
@Convert to Number
Code:
If {@Convert Test Results} = ">200" Then 200
Else
ToNumber({@Convert Test Results))
Then I determine whether the test results are in the range that I need
@In Therapy Range
Code:
If ({@Convert to Number} > 69 AND {@Convert to Number} < 111) Then "Y"
Else
"N"
When the report errors out, in the Formula Workshop it opens {@In Therapy Range}, highlights the first {@Convert to Number}.
I don't know where I've gone wrong or if I am trying to accomplish something that Crystal Reports will not allow me to do.
I only have view access to the database so I cannot create Views or Stored Procedures. I attempted to use a SQL Expressions Field but I received the same error response.
%Convert Test Results
Code:
{fn SUBSTRING("CDRObservation"."ValueText",1 ,4 )}