I'm using CR8 against an SQL Server 7 database.
I'm trying to write a stored procedure that takes two parameters to determine the type of report to generate.
There are four different reports and the only thing that is different is the WHERE clause.
Here's the four different WHERE clauses from the Record Selection Criteria from Crystal Reports:
if {?ReportType} = "1" then
{Bill.Owner} = {?Owner}
else
if {?ReportType} = "2" then
{Privilege.Supervisor} = {?Deputy}
else
if {?ReportType} = "3" then
{BillAssignments.Analyst} = {?Analyst}
else
if {?ReportType} = "4" then
(generate full report)
I would like to write the most efficient sp here but I don't know if it should have a CASE structure or IF, THEN, ELSE.
Can anyone give me a direction to pursue here?
Thanks in Advance.
John
I'm trying to write a stored procedure that takes two parameters to determine the type of report to generate.
There are four different reports and the only thing that is different is the WHERE clause.
Here's the four different WHERE clauses from the Record Selection Criteria from Crystal Reports:
if {?ReportType} = "1" then
{Bill.Owner} = {?Owner}
else
if {?ReportType} = "2" then
{Privilege.Supervisor} = {?Deputy}
else
if {?ReportType} = "3" then
{BillAssignments.Analyst} = {?Analyst}
else
if {?ReportType} = "4" then
(generate full report)
I would like to write the most efficient sp here but I don't know if it should have a CASE structure or IF, THEN, ELSE.
Can anyone give me a direction to pursue here?
Thanks in Advance.
John