| Author |
Topic |
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-06 : 05:39:03
|
| Hi all. I have a problem on my query. let me explain first the scenario. I have a windows application project that views a report through report viewer(Report of all employees that have a religion of adventist, born again, catholic, baptist, etc....). In my windows application, I have checkboxes for a specific religion. So, if I checked baptist and catholic, report generated is all employee that has religion of baptist and catholic. My concern is, How could i make a query of this? sample tables.table - employeedcno name religion1 jon baptist2 rose catholic3 joy baptist4 mike adventist5 soy born again6 rich protestantyou can supply additional table if needed.thanks-Ron- |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-06 : 05:44:49
|
| Why didn't you present your full problem the first time?Do you like to have us spend more time on you?Peter LarssonHelsingborg, Sweden |
 |
|
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-06 : 05:47:21
|
| Ah ok. what i want is, parameter is dynamically created. The number of parameters will depend on the input of the user. If the user checked born again, protestant, and catholic,,, the result is all employees that have religion like this. I think I made it clearer to you.thanks-Ron- |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-06 : 05:49:30
|
| Yes, but you haven't answered my somewhat rhetorical questions...The obvious counter-question is "how do you pass the selected religions to the stored procedure"?Peter LarssonHelsingborg, Sweden |
 |
|
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-06 : 06:00:21
|
| Ok. interaction of windows application and sql. C# windows application can manage to pass parameters to sql through reporting services. I just don't know how the procedure can catch the parameters but i think it can be. Is it possible that the parameter can be dynamically created? thanks-Ron- |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-06 : 06:48:35
|
| I got the answer. yewehhhhh.peso thanks for your time.KH i highly appreciate your help. I got the answer here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80004what i did is, in windows application i concatenate the selected religion seperated by a comma, and i passed it to @empreligion.DECLARE @religion varchar (100)SET @religion = @empreligionselect D.fullname, P.religion, E.empno from pspersonaldata as Pinner join hremployees as E on P.dcno = E.empdcnoinner join psdatacenter as D on D.dcno = E.empdcnoinner join CSVTable(@religion) as R on P.religion = R.stringvalThanks KH.-Ron- |
 |
|
|
|