Formatnumber Function Returns Error
The following code with formatnumber function returns me the following code. Why?
<td align="right"><Font
class=content4><%=formatNumber(ars.Fields("SOLD_AMOUNT"),2)%></td>
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'formatNumber'
View Replies
ADVERTISEMENT
I'm trying to set up a very simple asp page that sends me an email when it runs. This is just to try and get CDOSYS working so I can send out emails from my website.
Everything is fine right up until I execute the ".Send" method.
What could be wrong? What does the error mean?
The output from the source below is:
"test1 error '8004020f'
/mailtest.asp, line 34"
Here it is: Code:
View Replies
View Related
When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is three hours earlier than the time at which the Form is actually submitted.
I understand these functions are evaluated on the server so the server must be in a time zone three hours earlier than where I am . Is there any way I can get the local time at the location where the user is actually located. ?
View Replies
View Related
when i am working with currency or a number and apply the function formatnumber to a recordset or variable. I normally get funny results. e.g.
<%= FormatNumber((users.Fields.Item("purse").Value), 2, -2, -2, -2) %>
I normally get a value such as $ 1.000.000,00 instead of $1,000,000.00. what is wrong here.
View Replies
View Related
I'm working on finishing a project the was started by someone else who no longer works here. Its an asp page that takes a whack of numbers form a db, and makes em look all pretty in tables. (its a remake of an excel spreadsheet)
the problem is some of the numbers are not apearing properly. I'm thinking it's because they used Round() sometimes and formatNumber() other times.
the question is... do these functions handle numbers differently? i know formatNumber can do more then just round but i just need it to make the numbers 1 or 2 decimals.
View Replies
View Related
I'm having a problem with something that I "thought" wouldn't be too difficult.
I have some code that's pulling 2 number columns out of an Excel file, doing a calculation and giving me a result.... No Prob.
The result it's giving me is something like this: 2.89999999999999E-02
I want to format it to 2.899 but formatNumber gives me a type mismatch.
i've tried things like cint & cdbl but with no luck. I get the error Invalid use of Null: 'cdbl'
So I am at a loss, is there anyone that can shed some light on my problem?
View Replies
View Related
how do i use the function formatnumber and response.write object together. I have a script that checks to see if a record set is empty before using the response.write object.
<% if (ewallet.Fields.Item("purse").Value) <> "" then response.Write(ewallet.Fields.Itempurse").Value)
else
response.Write("Empty")
end if%>
What i need to achieve is to format the "PURSE" field
<% if (ewallet.Fields.Item("purse").Value) <> "" then
response.Write(Formatnumber(ewallet.Fields.Item("purse").Value), -1, -2, -2, -1) else
response.Write("Empty")
end if%>
But this gives an error, when i use both response.write(formatnumber(field_value)).
View Replies
View Related
This is the stubborn error I'm getting in my ASP code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Function sequence error
It points to the line: lrsQuery.MoveFirst, as below Code:
View Replies
View Related
Microsoft VBScript runtime error '800a0005'Invalid procedure call or argument: 'Mid' /uploaddoc.asp, line 15
Giving this error why??
Code is here:
Dim uploadsDirVar,pos,newpos,midstr
uploadsDirVar =request.QueryString("path")
pos=1
newpos=0
Do while newpos>=0
pos=Instr(newpos+1,uploadsDirVar,"")
midstr=Mid(uploadsDirVar,newpos+1,pos-newpos-1)
midstr=midstr & "/"
newpos=pos
Loop
View Replies
View Related
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/includes/adotest.asp, line 16
SaveTextDate(StrUrl,Chopper, ascii)
-----------------------------------^
is the error i get, and my mind is blank due 2 working 2 long but help much appreciated, i am just messing but would like to save a binaryfile with ADO.
Code:
View Replies
View Related
I have this piece of code in an ASP page: replace (strRootDir, "", "/", -1) When I run the script I get:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
II remove the parenthese then I get:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
Everthing that I found on the web (and in Studio help) indicates that "REPLACE (String, ToFind, With, Count)" is correct. What am I doing wrong?
View Replies
View Related
sql="Select orderid From orderDelivery WHERE orderDate = DateAdd(d,-1,GetDate())"
tis is my sql statement.but IE complaint abt the undefined Getdate function. or can teach how to code.
View Replies
View Related
In my application I get the error 'function sequence error' when i try to use RS.MoveFirst . This happens only in one screen but the same doesn't happen in another 2 screens where i am using RS.Movefirst. Code:
View Replies
View Related
I try to use the replace function with a very long text and I have this error :
error '80020009'
Exception occurred.
Do you have any idee to resolve this problem ?
View Replies
View Related
My question is
I use:
-----------------------------
dim strText,pos
strText = "This is a test!!"
pos = Instr(strText,"a",1)
response.write pos
-----------------------------
and i get:
Type mismatch: '[string: "This is a test!!"]'
What's going on?
View Replies
View Related
I'm having a problem with the Month function.this is a piece of code I use: Code:
dim getname
dim getmonth
dim getyear
getname=request("name")
getmonth=Month(Date)
response.write("month: "& getmonth)
I keep getting an error at the line in bold. It says some crap about "Type incompatible" and wont even print out the next line. What the hell is wrong with my code?
View Replies
View Related
I used this to sum column with nulls and it worked fine but then when I tried to do the same with the next column over, I get "IsNull function requires 2 arguments error".
In my select statement:
Sum(IsNull([1st Qtr],0)) as Sum1QN
The one above worked fine, so I thought I would just do the same for the next column over like so:
Sum(IsNull([2nd Qtr]),0)) as Sum2QN
View Replies
View Related
Has anyone seen an error like this before? If so, what could it be? I don't use any stored procedures. (SQL2000 and ASP). 007~ASP 0101~Unexpected error~The function returned |.
View Replies
View Related
Is it possible to do a database lookup in a javascript function *before* displaying the error alert?
We want to do a database table lookup first and get a BETTER error message based on the text field throwing the error.
View Replies
View Related
I currently am posting data to another site with ASP and in return that site returns a page that is XML. How can I grab this data programatically?
This is what the returned page looks like:
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Turnitin API Return Data
-->
- <returndata>
<rmessage>Successful!</rmessage>
<originalityscore>92</originalityscore>
<rcode>61</rcode>
</returndata>
View Replies
View Related
I have the following:-
<tr>
<td width="20%"><b>Typical Playing Hours</b></td>
<td width="80%"><textarea rows="3" name="TIMEON" cols="40"></textarea></td>
</tr>
Which users insert what time people usually play..
but if someone enters
Sat 10-11
Sun 13-15
it enters into the database as
Sat 10-11 Sun 13-15
how can i get it to carry the carrige return then it inserts it into my databaes?
View Replies
View Related
i am making a recordset paging in asp. the problem is the Previous Page, Next Page, and the Last Page wont work. only the first page is working. i have found out that the "pagenum" value is always equal to zero(0). could anybody help me with this problem? Code:
View Replies
View Related
how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to use:
'replace carriage returns with BRs
comment=Replace(comment, chr(13), "<br>")
but obviously net.!
The <pre> tag doesn't sem to help either as the embedded return is lost by the time you get past Request.Form
View Replies
View Related
I have a long list of checkboxes and a text field is associated with
each checkbox. So I created a loop that should get the value of each
text field that has a marked checkbox next to it. Here's my code
for each g in gildi
aths = Request.Form("rok_" & g)
...
next
then I create a query with the value and send it. Anyway here's my
problem:
the aths variable gets the correct value on the first iteration but is
blank every time after that.
View Replies
View Related
I am using asp to retrieve data from an SQL Server database and display it on a web page. The data in the database has been formatted using multiple carriage returns however, when the data is displayed on the page these carriage returns are lost.
View Replies
View Related
I am trying to run a command line from an ASP page. I am using windows 2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code:
View Replies
View Related
using mysql - vbscript and oledb provider
I have a table with 2 records
I do this in asp
rs.open "select count(*) as countervar from sqltable" ,oconn,1,1
response.write rs(0).value or response.write rs(0) gives zero and not 2 as to be expected
Also I would also like to be able to do calculations like this
rs.open "select 10 * 2 as result" ,oconn,1,1
response.write rs(0) also gives zero and not 20 as expected
can't this be done?
View Replies
View Related
What does ADO.RecordSet.Open return when the SQL query is an UPDATE or INSERT query?
View Replies
View Related
The code referer = request.servervariables("HTTP_REFERER") used to return a
requesting URL. It now returns blank. Anyone any idea what is happening?
View Replies
View Related
I have this code and it keeps spitting out -1 when I know there are 9 records, please help me.
Randomize
DIM cat,random_number(), counter, check,count
cat = Request("category")
Set cnn1 = Server.CreateObject("ADODB.Connection")
openStr = "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("database/images.mdb")
cnn1.Open openStr,"",""
sql = "SELECT * FROM gallery WHERE category = '" & cat & "' Order by ID"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, cnn1, adOpenDynamic, adLockOptimistic, adCmdText
count = rs.RecordCount
redim random_number(9)
View Replies
View Related
I have this sql query
SQL="SELECT title,body FROM cinema WHERE date_end > #" &date()& "#"
cinema is a table which contains announcements about cinema title,body (txt fields)are columns of my a table called cinema date_end(DATE/Time Field): is a date (DD/MM/YYYY, short format).This date shows when the announcements expire .But SQL returns all the announcements that the table contains even those that have already expired. Why??I cant find any mistake.
View Replies
View Related
I have a form with a <textarea></textarea> to receive user input. This input is then stored in a database and sent by fax... I need to be able to remove the carriage returns (enter key... vbcrlf...) from the input so that somebody doesn't do something like fill the textarea with 100s of keypresses of the enter key and end up spitting out tonnes of
blank pages on the fax machine.
View Replies
View Related
I am using asp to retrieve data from an SQL Server database and display it on a web page. The data in the database has been formatted using multiple carriage returns however, when the data is displayed on the page these carriage returns are lost. Does anyone know a way around this problem?
View Replies
View Related