Ask a Question related to Coldfusion Database Access, Design and Development.
-
lusciousmango #1
Query help requested
My boss has decided that he wants to mimic Gantt charts in our database, but
he's adamant about using the db so people can search. So, I've built
[url]http://www.avmet.com/wxreqs/ProdImp_in.cfm[/url]. He would like to be able to pass
the task value as well, as coded at
[url]http://www.avmet.com/wxreqs/TestProdImp_in.cfm[/url] and that's where I need some
help.
The table with the task information contains the following information:
Product Order TaskID Indent
Prod1 1 T-01 0
Prod1 2 T-02 1
Prod1 3 T-03 2
Prod1 4 T-04 1
Prod2 1 T-02 0
Prod2 2 T-03 1
and so forth. The "order" field is a sequentially numbered field that forces
the results to always display in that order for that product. Unfortunately,
the tasks are not always going to be the same level of indent -- some product
will have a task as a top level, another may have the same task as a subtask.
The query passes the Product variable, and the TaskID variable (either or both
or none can be selected). I've pasted my table code below. It works just fine
when no variables are passed, or if a product is passed.
I understand that when a specific task is chosen, it grabs only that one line
of code. How can I get it to grab all of the subtasks as well? I'm guessing
it needs to be a "do until 0" or something on the indent column -- am I on the
right track?
<CFIF #ProductQ.RecordCount# IS NOT '0'>
<CFOUTPUT>
<TABLE border="2">
<TR>
<TD CLASS="menuhead">Count</td>
<CFIF #form.ProdID# IS "">
<TD CLASS="menuhead">Product/<BR>Capability</td>
</cfif>
<CFIF #form.ImpTaskID# IS "">
<TD CLASS="menuhead">Implementation<BR>Task</td>
</cfif>
<TD CLASS="menuhead">Subtask</td>
<TD CLASS="menuhead">Sub-<BR>subtask</td>
<TD CLASS="menuhead">Responsible<BR>Organization</td>
<TD CLASS="menuhead">Date<BR>Due</td>
<TD CLASS="menuhead">Complete?</td>
</TR>
</CFOUTPUT>
</CFIF>
<CFOUTPUT QUERY="ProductQ">
<CFIF #ProductQ.Indent# IS "0">
<TR>
<td align="CENTER" valign="CENTER" class="table">#CurrentRow#</td>
<CFIF #form.ProdID# IS "">
<TD CLASS="table">#Product#</td>
</cfif>
<CFIF #form.ImpTaskID# IS "">
<TD CLASS="table">#ImpTask#</td>
</cfif>
<TD class="table"></td>
<TD class="table"></td>
<TD class="table">#OrgResp#</td>
<TD align="CENTER" valign="CENTER" class="table">#DateDue#</td>
<TD align="CENTER" valign="CENTER" class="table">#Completed#</td>
</TR>
</cfif>
<CFIF #ProductQ.Indent# IS "1">
<TR>
<td align="CENTER" valign="CENTER" class="table">#CurrentRow#</td>
<CFIF #form.ProdID# IS "">
<TD CLASS="table">#Product#</td>
</cfif>
<TD CLASS="table"></td>
<TD class="table">#ImpTask#</td>
<TD class="table"></td>
<TD class="table">#OrgResp#</td>
<TD align="CENTER" valign="CENTER" class="table">#DateDue#</td>
<TD align="CENTER" valign="CENTER" class="table">#Completed#</td>
</TR>
</cfif>
<CFIF #ProductQ.Indent# IS "2">
<TR>
<td align="CENTER" valign="CENTER" class="table">#CurrentRow#</td>
<CFIF #form.ProdID# IS "">
<TD CLASS="table">#Product#</td>
</cfif>
<TD CLASS="table"></td>
<TD class="table"></td>
<TD class="table">#ImpTask#</td>
<TD class="table">#OrgResp#</td>
<TD align="CENTER" valign="CENTER" class="table">#DateDue#</td>
<TD align="CENTER" valign="CENTER" class="table">#Completed#</td>
</TR>
</cfif>
</CFOUTPUT>
</table>
lusciousmango Guest
-
Tracking what has been requested
Hi I have created a php mysql web site where I am streaming videos, the user selects a video from a list then it displays on my detail page. I have... -
semicolon requested
Can someone help me on this. I'm trying to insert data into 2 tables using cf defined statements from the insert form wizard. When I run the code in... -
Requested resource in use
Win2K latest service packs IIS 5.0 Connecting to an Access DB *2003)- simple userlogin page, checks userpass & ID I'm all of a sudden getting the... -
Help Requested: Mac fh9 file to PC fh9+
Hi there, A friend used his Mac (0n system 9) to produce a file that I have burned to a CD. I specifically downloaded the latest trial of FH11... -
recreating a crosstab query - explanation of an example requested
Try this correlated subquery: Select distinct status, 10=(Select Count(MovementNo) from BigTable where size=10 AND status=Big.status),... -
The ScareCrow #2
Re: Query help requested
Look into the group attribute of cfoutput
<CFOUTPUT QUERY="ProductQ" group="Product">
<cfoutput group="Indent">
</cfoutput>
</cfoutput>
Ken
The ScareCrow Guest



Reply With Quote

