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 |
apociecha
Starting Member
17 Posts |
Posted - 2003-03-12 : 11:08:12
|
I need to display data retrieved from a recordset from a stored procedure in a tree control on an ASP page.My tree needs to look as follows:+ Strategy #1+ Strategy #2- Strategy #3 + Indicator #1 + Indicator #2 - Indicator #3 - Corp #1 UNIT NAME PERCENTILE INTERVAL INTERVAL YEAR Unit 1 17.00 Q1 2002 Unit 2 98.00 Q1 2002 Unit 3 78.50 Q1 2002 - Corp #2 UNIT NAME PERCENTILE INTERVAL INTERVAL YEAR Unit 1 72.00 Q1 2002 Unit 2 99.95 Q1 2002 Unit 3 12.50 Q1 2002 I have a table that has the following fields:StrategyId (need to link to table Y for Strategy Name)IndicatorID (need to link to table X for Indicator Name)CorpUnitPercentileIntervalIntervalYearStrategyId + IndicatorId + Corp + Unit make a unique record identifier.I know how to make the tree control work, but can anyone help with how to best query the data to get the result set? What I have so far is this:SELECT b.StrategyName AS StrategyName, a.StrategyId, c.IndicatorName AS IndicatorName, a.IndicatorId, a.Corp, a.Unit, a.Percentile, a.Interval, a.IntervalYearFROM NewIndicators a INNER JOIN StrategyDescription b ON a.StrategyId = b.StrategyIDINNER JOIN IndicatorDescription cON (a.StrategyId = c.StrategyIdAND a.IndicatorId = c.IndicatorId)ORDER BY a.StrategyId, a.IndicatorId, a.Corp, a.UnitIs it possible to get the data somehow without retrieving all unique strategies, indicators and corps and then building the SQL command?Thanks in advance,Agnes |
|
HarryMann
Starting Member
33 Posts |
Posted - 2003-04-02 : 08:43:17
|
I think you may have to reword this a bit less specific. You're assuming an intimate knowledge of a lot of things here, including ASP treeviews. I've done a big VB Treeview using SQL sp's and found that the table structure is the key, you may have to take the data tables and coerce them into tables that reflect the tree structure more closely.Inserts, Updates and Deletes from the treeview can be quite fun.Don't expect this helps much, but had a job working out ahat you were actually askingHarry |
 |
|
apociecha
Starting Member
17 Posts |
Posted - 2003-04-03 : 18:13:02
|
Thanks for taking the time to try to figure out what I'm asking...I see your point about my TOO specific of a question (and a lengthy one). I understand what you mean by "coerce them into tables that reflect the tree structure more closely" and I see that I'm in for a fun ride Agnes |
 |
|
|
|
|
|
|