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!

creating a new view/ parameter

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
So I want to create a view. I have a table and based on the code type, and coverage it should pull up a severity associated with it.

Data:
CODE_TYPE CODE- CODE_DESC coverage
100081 A- No Error capacity to cause error MED
100081 B- Error No Harm did not reach patient MED
100081 C- Error No Harm reached patient MED
100081 D- Error No Harm reach pt MED
100081 E- Error Harm Temporary reqd intervention MED
100081 F- Error Harm Temporary req MED
100081 G- Error Harm contributed to MED
100081 H- Error Harm Req Intervention MED
100081 I- Error Death MED
100084 00-Near Miss ADR, BEH,LAB, EQUI, MAT, SURG, PCE, IVBP
100084 01 No Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 02-No Detectable Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 03-Minimal - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 04-Minimal - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 05-Moderate - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 06-Moderate - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 07-Severe - Temporary Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 08-Severe - Permanent Harm ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
100084 09-Death ADR, BEH, LAB, EQUI, MAT, SURG, PCE, IVBP
98 05-None FALL
98 10-Minor FALL
98 15-Moderate FALL
98 20-Major FALL
98 25-Death FALL


SQL Query:
SELECT "IRSCODE"."CODE_TYPE", "IRSCODE"."CODE", "IRSCODE"."CODE_DESC", "IRSCODE"."CODE_MAJ"
FROM "Stars"."stars"."IRSCODE" "IRSCODE"

Selection Criteria:
If {IRSCODE.CODE_MAJ} = "FALL" then {IRSCODE.CODE_TYPE}= "98" else
If {IRSCODE.CODE_MAJ} = "MED" then {IRSCODE.CODE_TYPE}= "100081" else
If {IRSCODE.CODE_MAJ} = "****" then {IRSCODE.CODE_TYPE}= "100084"

What I want to do is to be able to create a view using the SQL Query, and then turn that view into a parameter, having the user select the coverage, and then the severity code and description would appear, based on the selected criteria.

I hope I explained this well, I am using Crystal XI.

Thanks
 
If you want to code your own SQL, use Database > Database Expert, select your database and then use the [Add Command] option. Best to have developed the SQL first and to paste it, but you could do it directly.

Beyond this, it is unclear what you are after. Please clarify, if you still need help.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top