|
| |
|
|
Bnugent
Posts: 255 From: Tampa Florida Tampa, FL USA Status: offline
|
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?
_____________________________
Brian---
|
|
|
|
Bnugent
Posts: 255 From: Tampa Florida Tampa, FL USA Status: offline
|
RE: strange DB Error - 1/30/2008 22:39:03
quote:
<%="sum = "&total &" / "& monthsupply%></ Spooky...Sorry, but I don't understand...I tried the code above and got syntax errors... I really only know enough to be dangerous but it is unusual that it always stops at the same line item/record (the 44th in fact)... If I take out the division field, it shows all results...the issue is, I need to display that field... can you explain exactly wht I should do? Sorry..
_____________________________
Brian---
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: strange DB Error - 1/30/2008 22:59:31
quote:
If I take out the division field, it shows all results Does monthQTYSOLD ever equal 0? That would give a 'divide by zero' error. Maybe the 45th result is 0? Just a quick thought. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: strange DB Error - 1/31/2008 9:33:07
quote:
<%monthsupply= total / (FP_FieldVal(fp_rs,"monthQTYSOLD"))%> How about something like this: <% IF FP_FieldVal(fp_rs,"monthQTYSOLD") = 0 Then monthsupply = 0 Else monthsupply= total / (FP_FieldVal(fp_rs,"monthQTYSOLD")) End If%> Or something to that effect. That any help?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Bnugent
Posts: 255 From: Tampa Florida Tampa, FL USA Status: offline
|
RE: strange DB Error - 1/31/2008 9:39:20
your the man!!!! Seems so simple now...
_____________________________
Brian---
|
|
|
|
Spooky
Posts: 26597 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: strange DB Error - 1/31/2008 14:15:45
Yep - thats what I was trying to discover by writing the values ;-)
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|