I have created a SQL Server view for a Crystal 8.5 report. The view returns a Remark field, which is a compilation of remarks from several tables. If a remark in a table is empty, there should be no output in the report. If the remark is not empty, the output identifies the table as well as displaying the remark. This is the part of the view that pulls the data:
Remark = Substring(IsNull(' (Log) ' + L.Comment,'')
+ IsNull(' (Sieve) ' + S.LabRemark,'')
+ IsNull(' (Sieve8) ' + S8.LabRemark,'')
+ IsNull(' (PI) ' + PI.LabRemark,'')
+ IsNull(' (R-Value) ' + R.LabRemark,'')
+ IsNull(' (Proctor) ' + PR.LabRemark,'')
+ IsNull(' (Agg. Prop.) ' + AP.LabRemark,'')
+ IsNull(' (Soil Prop.) ' + SP.LabRemark,'')
+ IsNull(' (Hydrometer) ' + H.LabRemark,'')
+ IsNull(' (Consol) ' + C.LabRemark,'')
+ IsNull(' (Dir. Shear) ' + DS.LabRemark,'')
+ IsNull(' (Spec. Grav.) ' + SG.LabRemark,'')
+ IsNull(' (Misc) ' + M.LabRemark,''), 1, 255),
When I run a select statement against the view, I get the output I want. For example, the Remark field contains:
(Log) SALog Comment (Sieve) Sieve remark (PI) PI Remark
However, when I run the report, I get the label for every table, even when the remark field is null.
For example:
(Log) SALog Comment (Sieve) Sieve remark (Sieve8) (PI) PI Remark (R-Value) (Proctor) - etc.
The Sieve8, R-Value and Proctor tables have no remarks, and should not show up in the report, but they do.
Any idea what is going on?
Thanks.
Remark = Substring(IsNull(' (Log) ' + L.Comment,'')
+ IsNull(' (Sieve) ' + S.LabRemark,'')
+ IsNull(' (Sieve8) ' + S8.LabRemark,'')
+ IsNull(' (PI) ' + PI.LabRemark,'')
+ IsNull(' (R-Value) ' + R.LabRemark,'')
+ IsNull(' (Proctor) ' + PR.LabRemark,'')
+ IsNull(' (Agg. Prop.) ' + AP.LabRemark,'')
+ IsNull(' (Soil Prop.) ' + SP.LabRemark,'')
+ IsNull(' (Hydrometer) ' + H.LabRemark,'')
+ IsNull(' (Consol) ' + C.LabRemark,'')
+ IsNull(' (Dir. Shear) ' + DS.LabRemark,'')
+ IsNull(' (Spec. Grav.) ' + SG.LabRemark,'')
+ IsNull(' (Misc) ' + M.LabRemark,''), 1, 255),
When I run a select statement against the view, I get the output I want. For example, the Remark field contains:
(Log) SALog Comment (Sieve) Sieve remark (PI) PI Remark
However, when I run the report, I get the label for every table, even when the remark field is null.
For example:
(Log) SALog Comment (Sieve) Sieve remark (Sieve8) (PI) PI Remark (R-Value) (Proctor) - etc.
The Sieve8, R-Value and Proctor tables have no remarks, and should not show up in the report, but they do.
Any idea what is going on?
Thanks.