Consider this table-<BR> <BR>directorykey directoryname substructureof<BR>1 engineering &#060;NULL&#062;<BR>2 group1 1<BR>3 group2 1<BR>4 group3 1<BR>5 sub1 4<BR>6 sub2 4<BR> <BR>I&#039;m using this Select statement-<BR> <BR>SELECT d3.directoryname + d2.directoryname + d1.directoryname AS<BR> full_path<BR>FROM directory d1, directory d2, directory d3<BR>WHERE d1.directorykey = 3 AND <BR> d1.substructureof = d2.directorykey AND <BR> d2.substructureof = d3.directorykey;<BR> <BR>In the WHERE clause, if I set d1.directorykey &#062;= 5 then I will get the path.<BR> <BR>If in the WHERE clause, I set d1.directorykey &#060; 5 I get nothing....and in my code I get all kinds of BOF or EOF are TRUE error messages.<BR> <BR>This tells me that I might need to do some conditional stuff in the WHERE clause so that if someone chooses a group instead of a sub, I can still get the path info.<BR> <BR>Can I do conditional stuff within a Select statement or do I need to figure out a way to do what I want in my code?<BR><BR>I&#039;m also thinking that I need a Stored Proc that dynamically creates a query based on the directory key passed in, and how many iterations it takes to get to the top-level directory record.<BR><BR>Has anyone done this kinda stuff before? Any ideas to get me going?<BR><BR>Thanks!