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.

 All Forums
 Other Forums
 MS Access
 SQL Formatting Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-05-18 : 07:29:02
Brad writes "Hi there,

I have been working on this statement for some time and have asked around here and there for some help with this. Hopefully someone here might be able to set me int he right direction.

Im trying to code a menu for a website that has a treeview like structure and pulls all the information from a database for the menu. I have a access 2002 Database with the fields ID, SUBID, Location, PageName, Link, Target, LinkTitle, VisibleLink. the first two fields are pretty strait forward the ID is autogenerated, the SUBID field is in relation to the ID field for creating a setup similar to that of using a treeview control. Location is were the link should be placed when it gets to the asp page i.e, parent, child, grandchild etc...,Link is the URl of the menu item, Target shows wether the link should open in a nw page or not, VisibleLink allows you to hid a link. basically what i have been trying are sub queries with grouping and union statements but cant seem to get anything to work. below is and example of the database structure and what i want to return from that structure

ID SUBID PageName etc..............
-------------------------------------------------------
1 0 Something
2 0
3 0
4 2
5 4
6 1
7 1
8 6
9 4


ID SUBID PageName etc..............
-------------------------------------------------------
1 0 Linkone
2 0 Linktwo
4 2 Linkthree
5 4 Linkfour
9 4 Linkfive
3 0 Linksix


The results in the menu would be like this if the user had selected either Linkthree, Linkfour or Linkfive from the menu:


Linkone
Linktwo
-----LinkThree
---------LinkFour
---------LinkFive
LinkSix


Thank you for anyhelp you might have.


Brad"

SMerrill
Posting Yak Master

206 Posts

Posted - 2005-08-10 : 21:18:54
This topic is old...did you get your answer yet?

~ Shaun Merrill
Seattle, WA
Go to Top of Page
   

- Advertisement -