Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Stored Procedure Return Post Reply Post New Topic
Author Message
katfoxus
Newbie
Newbie
Avatar

Joined: 17 Oct 2011
Location: United States
Online Status: Offline
Posts: 19
Quote katfoxus Replybullet Topic: Stored Procedure Return
     Posted: 06 Jun 2012 at 4:44am
I have a stored procedure created that I need to return model sets for a client. I have about 10 model sets that need to be under the @Report parameter i have. The basic function of the stored procedure pulls multiple columns from the database then joins a view that flattens out a self referencing table. The view is where I need to pull my model sets from. Is there anyone that can help me define my @Report parameter to show the model sets.
 
ex.
 
IF @Report = 'Model Set A' then view.code in ['4750','4760']
IF @Report = 'Model Set B' then view.code in ['4870']
 
I set the @Report as varchar and then declared @model_set varchar as well. I was using a select case in the where clause but when i execute my procedure i still get all the model numbers.
IP IP Logged
katfoxus
Newbie
Newbie
Avatar

Joined: 17 Oct 2011
Location: United States
Online Status: Offline
Posts: 19
Quote katfoxus Replybullet Posted: 06 Jun 2012 at 10:58am
Ok, so figured this one out on my own :). I had to put the base columns i needed into a repeated select statement and each model set specified those. Each seciton of the code consisted of If @report = 'abcd' then the select statement with the model specifications in the where clause. There may be a shorter easier way to do this but I got it working.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum