Results 1 to 1 of 1
Thread: problem with mysql decimal field
May 20, 2005, 14:41 #1
- Join Date
- Aug 2002
- center pixel
- 0 Post(s)
- 0 Thread(s)
problem with mysql decimal field
First of all, it is late Friday afternoon which is part of the problem
I am trying to display a datafield that is a decimal number in mySQL thru ASP. The numbers after the decimal point do not display (i.e. 5.75 appears as 5.00). The second problem I am encountering is that if there is more than one record, assigning a variable to add the records for a total.
I have tried some ASP conversions (CInt and FormatNumber for example) with no luck but I admit I am not very knowledgeable in doing that.
Here is the sql statement for getting the info:
Set RSOrderItems = db.Execute("Select OrderID, StockID, ProductName, ProductWeight, SalePrice From a_table Where CustomerID = " & thisID &"")
Here is ASP for displaying and adding the weight. The Price data is displaying and adding together with no problem.
<% 'OrderWeight = FormatNumber(OrderWeight,2) Do Until RSOrderItems.EOF %> <TR> <TD WIDTH=500><%= RSOrderItems("ProductName") %> <TD WIDTH=100> <% Response.Write FormatCurrency(RSOrderItems("SalePrice"),2) %> <TD WIDTH=100> <% Response.Write FormatNumber(RSOrderItems("ProductWeight"),2) %> </TR> <% OrderTotal = OrderTotal + RSOrderItems("SalePrice") ' OrderWeight = OrderWeight + RSOrderItems("ProductWeight") RSOrderItems.MoveNext Loop %>
JamesEverything is going as planned...now where is that ball of twine.