Hello -
Using Crystal 8.5, SQL Server, ODBC
I have only one table - Courses. One field in the table is named competency. There are 15 choices for competency(Collaboration, Communications, etc.). My goal is to report on this field, i.e. show all courses that have a certian competency. The problem is that a course can have more than one competency, and if it does they are stored in the same field delimited by a space. So I need the user to be able to select from a parameter list one or more of the 15 possible competencies, and show the course if any of the parameter values are part of the competency string. I would like to be able to select records based on something akin to the following:
(
if {?Competency} <> "ALL" then
(
if UBound({?Competency}) > 1 then
(
for i := 1 to UBound({?Competency}) do
instr({course.competency}, ({?Competency}[x])) <> 0
)
else {course.competency} = {?Competency}
)
else true
)
This formula produces 0 errors but returns all records where {course.competency} is not null. The for loop is where I am attempting to say "If the first value of {?Competency} is in the {course.competency} field then select it, if the second value of {?Competency} is in the {course.competency} field then select it, etc.
I hope this makes sense, and will be glad to provide more info if necessary.
One more thing - Our data is stored on an external vendors server and I cannot create views, change table format, etc. Can only use Crystal to report on what is already there
Gary
Using Crystal 8.5, SQL Server, ODBC
I have only one table - Courses. One field in the table is named competency. There are 15 choices for competency(Collaboration, Communications, etc.). My goal is to report on this field, i.e. show all courses that have a certian competency. The problem is that a course can have more than one competency, and if it does they are stored in the same field delimited by a space. So I need the user to be able to select from a parameter list one or more of the 15 possible competencies, and show the course if any of the parameter values are part of the competency string. I would like to be able to select records based on something akin to the following:
(
if {?Competency} <> "ALL" then
(
if UBound({?Competency}) > 1 then
(
for i := 1 to UBound({?Competency}) do
instr({course.competency}, ({?Competency}[x])) <> 0
)
else {course.competency} = {?Competency}
)
else true
)
This formula produces 0 errors but returns all records where {course.competency} is not null. The for loop is where I am attempting to say "If the first value of {?Competency} is in the {course.competency} field then select it, if the second value of {?Competency} is in the {course.competency} field then select it, etc.
I hope this makes sense, and will be glad to provide more info if necessary.
One more thing - Our data is stored on an external vendors server and I cannot create views, change table format, etc. Can only use Crystal to report on what is already there
Gary