diecasthft01
asked on
another question with Coldfusion queries and group by
I had this question after viewing Getting data within a CFLOOP.
Hell again!! I wanted to try to expand on a functionality that I was helped with on here, and hopefully it will be a simple oversight on my part, but I wanted to get all of the records for one project and have those records placed in a textarea box, and that works great. But I also want to have a second textarea box that only shows the most recent comment per project number, and that textarea box will be modifiable, so a user can change the change inside that single comment on that textarea box. The code I have is below, but I can't seem to get the query right to get the single record for one textarea, while also getting all records for the other textarea.
<CFQUERY DATASOURCE="PDBARMYDEV" NAME="CecomInput">
SELECT current_bulk_filter.proj_n o,
current_bulk_filter.capces _location,
current_bulk_filter.capces _state,
current_bulk_filter.capces _descripti on,
capces_support_history.pro j_closed_r eason
FROM mca.current_bulk_filter
left join mca.capces_support_history
on current_bulk_filter.proj_n o = capces_support_history.pro j_no
where capces_support_history.pro j_closed_r eason is not null
order by current_bulk_filter.proj_n o asc
</CFQUERY>
<cfoutput query="CecomInput" group="proj_no">
<!--- This will print once for every project --->
proj_no = #proj_no#<br>
<!--- This will print each reason within a single textarea --->
<textarea><cfoutput>#proj_ closed_rea son##chr(1 0)#</cfout put></text area>
<br>
</cfoutput>
Hell again!! I wanted to try to expand on a functionality that I was helped with on here, and hopefully it will be a simple oversight on my part, but I wanted to get all of the records for one project and have those records placed in a textarea box, and that works great. But I also want to have a second textarea box that only shows the most recent comment per project number, and that textarea box will be modifiable, so a user can change the change inside that single comment on that textarea box. The code I have is below, but I can't seem to get the query right to get the single record for one textarea, while also getting all records for the other textarea.
<CFQUERY DATASOURCE="PDBARMYDEV" NAME="CecomInput">
SELECT current_bulk_filter.proj_n
current_bulk_filter.capces
current_bulk_filter.capces
current_bulk_filter.capces
capces_support_history.pro
FROM mca.current_bulk_filter
left join mca.capces_support_history
on current_bulk_filter.proj_n
where capces_support_history.pro
order by current_bulk_filter.proj_n
</CFQUERY>
<cfoutput query="CecomInput" group="proj_no">
<!--- This will print once for every project --->
proj_no = #proj_no#<br>
<!--- This will print each reason within a single textarea --->
<textarea><cfoutput>#proj_
<br>
</cfoutput>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad it helped!
ASKER