Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mihirvb84
Starting Member
11 Posts |
Posted - 2011-12-19 : 09:34:31
|
I want to build a query by giving a excel cell reference for a Constraint.TABLE - APerson X Person Y2008 2009 2010 2008 2009 2010Type A 12 15 11 11 12 15Type B 13 14 10 10 13 14Total 25 29 21 21 25 29For example, Select * from Table A where Person = 'X' and Period = '2009'Now instead putting exact value for Person and Period constraints, I want to use excel cell reference. Can anyone please let me know what changes are required in the query above for making this possible?---------------Mihir Borde |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
mihirvb84
Starting Member
11 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-19 : 11:05:51
|
hmm...why so? what else you're expecting?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-12-19 : 12:15:09
|
If you are doing this from Excel, insert a question mark in the query and you will be prompted for the parameters.Select * from Table A where Person = ? and Period = ? Also, in the connection properties -> Properties->Parameters (from Excel), you can select a cell from which to pick up the value of the parameter. This page has a description, but with each version of Excel, they have changed the set up and navigation to these screens that it is hard to tell without knowing your version of Excel. |
|
|
|
|
|