嗨我正在嘗試以下操作:ASP試圖從數據庫中轉換出來並將這兩個值相乘
代碼是用ASP編寫的,輸出來自數據庫。我正在嘗試將數量和速率#2相乘,並在返回的數據中顯示每個訂單的總數。這涉及輸出中的最後一個td。
<td align="center" height="30"><%= rowCrossHire("NLCODE") %></td>
<td align="center" height="30"><%= rowCrossHire("QTY") %></td>
<td align="center" height="30"><%= rowCrossHire("QTYRETD") %></td>
<td align="center" height="30"><%= formatcurrency(rowCrossHire("RATE#1"), 2) %></td>
<td align="center" height="30"><%= need to add "QTY" * "RATE#1" here %></td>
還有什麼需要請讓我知道 預先感謝 大衛
<table>
<%
crosshireSQL = "SELECT CONTITEMS.CONTNO, CONTITEMS.ITEMDESC, CONTITEMS.ITEMDESC#2, CONTITEMS.RATE#1, CONTITEMS.ITEMDESC#3, CONTITEMS.ITEMNO, CONTITEMS.NLCODE, CONTITEMS.QTY, CONTITEMS.QTYRETD, CONTITEMS.STATUS, CONTRACTS.ACCTNAME FROM CONTITEMS INNER JOIN CONTRACTS ON CONTRACTS.CONTNO = CONTITEMS.CONTNO WHERE CONTITEMS.NLCODE IN ('4001') AND CONTITEMS.STATUS = 1 ORDER BY CONTITEMS.CONTNO ASC, CONTITEMS.ITEMNO ASC"
set rowCrossHire = returnRecordSet(crosshireSQL)
currentContract = ""
if not rowCrossHire.eof then
' cross hires found
do while not rowCrossHire.eof
' loop through cross hires
if currentContract <> rowCrossHire("CONTNO") then
' new contract
%>
<tr class="contract">
<th colspan="11"> </th>
</tr>
<%
currentContract = rowCrossHire("CONTNO")
end if
sonNo = "Pre SONs"
sonSQL = "SELECT SONID, SONRevision FROM SONs WHERE SONContractNo LIKE '%" & rowCrossHire("CONTNO") & "%' ORDER BY SONID ASC LIMIT 1"
set rowSON = returnRecordSetOnline(sonSQL)
if not rowSON.eof then
' son found
sonRevision = ""
if cint(rowSON("SONRevision")) > 0 then
' son revision found
sonRevision = chr((cint(rowSON("SONRevision")) + 96))
end if
sonNO = "<a href=""http://admin.boilerrentalservices.co.uk/sons/list/view-menu.php?SONID=" & rowSON("SONID") & """ target=""_blank"" title=""View " & rowSON("SONID") & sonRevision & """>" & rowSON("SONID") & sonRevision & "</a>"
end if
itemDescription = rowCrossHire("ITEMDESC")
if trim(rowCrossHire("ITEMDESC#2")) <> "" then
' additional description
itemDescription = itemDescription & ", " & rowCrossHire("ITEMDESC#2")
end if
if trim(rowCrossHire("ITEMDESC#3")) <> "" then
' additional description
itemDescription = itemDescription & ", " & rowCrossHire("ITEMDESC#3")
end if
%>
<tr>
<td height="30"><a href="/dashboard-fullscreen/individual/contracts/view.asp?Allow=f875eba085941cc78509bd3482dc0294&Contract=<%= rowCrossHire("CONTNO") %>" target="_blank" title="View <%= rowCrossHire("CONTNO") %>"><%= rowCrossHire("CONTNO") %></a></td>
<td height="30"><%= sonNo %></td>
<td height="30"><%= rowCrossHire("ACCTNAME") %></td>
<td height="30"><%= rowCrossHire("ITEMNO") %></td>
<td height="30"><%= itemDescription %></td>
<td align="center" height="30"><%= getItemStatus(rowCrossHire("STATUS")) %></td>
<td align="center" height="30"><%= rowCrossHire("NLCODE") %></td>
<td align="center" height="30"><%= rowCrossHire("QTY") %></td>
<td align="center" height="30"><%= rowCrossHire("QTYRETD") %></td>
<td align="center" height="30"><%= formatcurrency(rowCrossHire("RATE#1"), 2) %></td>
<td align="center" height="30"><%= need to add "QTY" * "RATE#1" here %></td>
</tr>
<%
rowCrossHire.movenext
loop
end if
%>
<tr class="contract">
<th colspan="11"> </th>
</tr>
</table>
這是asp.Net還是asp-classic,他們是**完全不同的** – Liam
@Liam似乎像asp-classic我rettagged反映了這個 – Rafael
@David你的代碼這是一個混亂和**爲上帝的緣故思考如何您是否標記了您的問題** – Rafael