Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selection Formula help needed like yesterday! 1

Status
Not open for further replies.

tektribe

Programmer
Jan 30, 2003
5
US
Hello all,
Need help going farther writing formulas.

I am using Crystal 8.5, pulling data from SQL tables that houses client medical data.

The {disability_score.population_category_1} field contains target populations such as “AMSPM,” “AMSMI,” “AMPAT” and the {cdw_diagnosis_update.primary_diagnosis}[/] field contains diagnosis information such as “295.0,” “295.10,” “295.11,” “295.68&310.012,” “310.22” etc. I want to the consumers who have a target population of say AMSPM and do not have the following diagnosis: 295.0-295.99, 296.0-296.99, & 298.9. In addition, I only want the report to look at the first 6 digits in the {cdw_diagnosis_update.primary_diagnosis} field, in such an instance that a client may have multiple diagnoses (as noted in bold type above).

This is the formula that I a have tried to use with no success. It tells me that a Boolean expression is expected after the first AND.

{disability_score.population_category_1} = "AMSPM"
and
left ({cdw_diagnosis_update.primary_diagnosis},6)
and
not
({cdw_diagnosis_update.primary_diagnosis} like "295*,""296*,""298.9")

I am wondering if I need to be using the trim function but that seems to be easier said than done. Also, where do i insert the formula? Any help and/or suggestions would greatly be appreciated as I am new to Crystal formulas beyond the basics.

Thanks
-T
 
Try:

{disability_score.population_category_1} = "AMSPM"
and
not(left(trim({cdw_diagnosis_update.primary_diagnosis}),3)
in ["295","296"]) and
not(left(trim({cdw_diagnosis_update.primary_diagnosis}),5) = "298.9")

However, if you are trying to exclude people with these diagnoses and there can be multiple diagnosis records, this won't do the trick. If diagnoses are always in one record only and you also don't care if these diagnoses codes occur as the second element of the diagnosis field, then the above should work.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top