Using Crystal XI and MS SQL Server 2005
Here is the record selection criteria
When I look at the SQL Query in Crystal this is what I find
For whatever reason it will not respect my parens and retunrns incorrect data.
I did get this to work correctly by creating a command, but would like to know if there is a way to force Crystal to honor my groupings in the record selection criteria.
Here is the record selection criteria
Code:
(
(
{SURGICAL_HX.COMMENTS} like "*mastec*" and
{CLARITY_EAP.PROC_CODE} like "990500" and
not({SURGICAL_HX.COMMENTS} like "*partial mastectomy*")
)
or
(
{CLARITY_EAP.PROC_CODE} like
["19180*","19182*","19200*","19220*","19240*",
"19303*","19304*","19305*","19306*","19307*"]
)
)
When I look at the SQL Query in Crystal this is what I find
Code:
WHERE
(
"SURGICAL_HX"."COMMENTS" LIKE '%mastec%' AND
"CLARITY_EAP"."PROC_CODE" LIKE '990500' AND
"SURGICAL_HX"."COMMENTS" NOT LIKE '%partial mastectomy%'
OR
(
"CLARITY_EAP"."PROC_CODE" LIKE '19180%'OR
"CLARITY_EAP"."PROC_CODE" LIKE '19182%'OR
"CLARITY_EAP"."PROC_CODE" LIKE '19200%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19220%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19240%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19303%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19304%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19305%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19306%' OR
"CLARITY_EAP"."PROC_CODE" LIKE '19307%'
)
)
For whatever reason it will not respect my parens and retunrns incorrect data.
I did get this to work correctly by creating a command, but would like to know if there is a way to force Crystal to honor my groupings in the record selection criteria.