|
Bnugent -> strange DB Error (1/30/2008 20:59:23)
|
Using DRW on spooky diet and SQL Server... Here is my code:
<!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT IV00102.ITEMNMBR, Max(IV00101.ITEMDESC) AS DESCRIPTION, Max(IV00102.PRIMVNDR) AS VENDOR, Max(IV00101.CURRCOST) AS COST, Max(IV00102.QTYONHND) AS QTYONHAND, Max(IV00102.ATYALLOC) AS QTYALLOCATED, Max(IV00102.QTYONORD) AS ONORDER, Sum(SOP30300.QUANTITY/12) AS monthQTYSOLD, Sum(SOP30300.QUANTITY/48) AS weekQTYSOLD, Sum(SOP30300.QUANTITY/360) AS dayQTYSOLD FROM IV00102 INNER JOIN SOP30300 ON IV00102.ITEMNMBR = SOP30300.ITEMNMBR INNER JOIN SOP30200 ON SOP30300.SOPTYPE = SOP30200.SOPTYPE AND SOP30300.SOPNUMBE = SOP30200.SOPNUMBE INNER JOIN IV00101 ON IV00102.ITEMNMBR = IV00101.ITEMNMBR WHERE IV00101.ITMGEDSC = 'report' AND (SOP30200.DOCDATE > DATEADD(d, - 180, GETDATE())) AND SOP30200.SOPTYPE=3 AND SOP30300.SOPTYPE=3 GROUP BY IV00102.ITEMNMBR ORDER BY IV00102.ITEMNMBR ASC;"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=10 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="SBM"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=9
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%total= FP_FieldVal(fp_rs,"QTYONHAND") - FP_FieldVal(fp_rs,"QTYALLOCATED")%>
<%monthsupply = total / (FP_FieldVal(fp_rs,"monthQTYSOLD"))%>
<tr>
<td><font size="2">
<%=FP_FieldVal(fp_rs,"ITEMNMBR")%></font> </td>
<td><font size="2">
<%=FP_FieldVal(fp_rs,"DESCRIPTION")%></font> </td>
<td><font size="2">
<%=FP_FieldVal(fp_rs,"VENDOR")%></font> </td>
<td align="center"><font size="2">
<%=FormatNumber(FP_FieldVal(fp_rs,"monthQTYSOLD"),0)%></font> </td>
<td align="center"><font size="2">
<%=FormatNumber(FP_FieldVal(fp_rs,"weekQTYSOLD"),0)%></font> </td>
<td align="center"><font size="2">
<%=FormatNumber(FP_FieldVal(fp_rs,"dayQTYSOLD"),0)%></font> </td>
<td align="center"><font size="2">
<%=(total)%></font> </td>
<td align="center"><font size="2">
<%=FormatNumber((monthsupply),2)%></font> </td>
<td align="center"><font size="2">
<%=FP_FieldVal(fp_rs,"ONORDER")%></font> </td>
</tr>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
The error I get directly above my results says: Microsoft VBScript runtime error '800a0006' Overflow /inventorycheck.asp, line 67 And more importantly, it show me only the first 44 results...It simply stops after that... When I delete the ASP code: <%total= FP_FieldVal(fp_rs,"QTYONHAND") - FP_FieldVal(fp_rs,"QTYALLOCATED")%> <%monthsupply = total / (FP_FieldVal(fp_rs,"monthQTYSOLD"))%> I dont get this error and I get all the results, of course my fields don't calculate... I am at a quandry...anyone have any ideas... by the way, line 67 in my code is: <%monthsupply= total / (FP_FieldVal(fp_rs,"monthQTYSOLD"))%> Spooky? Rdouglass? Anyone? Bueller? Bueller? Bueller?
|
|
|
|