0
這裏是查詢:如何計算產品的價格(ColdFusion的)名單的總和
<cfquery name="GET_SHIP_ROW" datasource="#DSN2#">
SELECT
SR.*,
S.STOCK_CODE
FROM
SHIP_ROW SR,
#dsn3_alias#.STOCKS S
WHERE
SR.STOCK_ID = S.STOCK_ID AND
SR.SHIP_ID = #attributes.ship_id#
ORDER BY
SR.SHIP_ROW_ID
</cfquery>
,比如我有價格的循環代碼:
<cfloop from="#satir_start#" to="#satir_end#" index="i">
<cfif i lte get_ship_row.recordcount>
<cfscript>
if(len(get_ship_row.discount[i]))indirim = get_ship_row.discount[i]; else indirim = 0;
adim_1 = get_ship_row.amount[i] * get_ship_row.price[i];
adim_2 = (adim_1/100)*(100-indirim);
adim_3 = adim_2*(get_ship_row.tax[i]/100);
adim_4 = adim_2+adim_3;
</cfscript>
<cfquery name="GET_BARCODE" datasource="#DSN3#">
SELECT
BARCOD
FROM
PRODUCT
WHERE
PRODUCT_ID = #get_ship_row.product_id[i]#
</cfquery>
<table>
<tr>
<td style="width:30mm;"><cfoutput>#get_ship_row.stock_code[i]#</cfoutput></td>
<td style="width:50mm;"><cfoutput>#left(get_ship_row.name_product[i],53)#</cfoutput></td>
<td style="width:25mm;" align="right"><cfoutput>#get_ship_row.amount[i]# #get_ship_row.unit[i]#</cfoutput></td>
<td style="width:25mm;" align="right"><cfoutput>#TLFormat(get_ship_row.price[i])#</cfoutput> TL</td>
<td style="width:35mm;" align="right"><cfoutput>#TLFormat(get_ship_row.amount[i] * get_ship_row.price[i])#</cfoutput> TL</td>
</tr>
</table>
</cfif>
</cfloop>
顯示有所有我想要統計的名稱及其價格清單是它們的價格總和,我的意思是所有的產品。我該如何下手? thx求助!
我如何在代碼中插入它?喜歡這個? ` #TLFormat(get_ship_row.shipmentTotal)# `或像這樣` #TLFormat(total.shipmentTotal)# ` –
abrabr
2011-02-15 13:09:39