Re: Format Percent



George wrote:

Hi all,

I have the following code:

<% =FormatPercent(ors("lurpen"),2) %>

The field "lurpen" is coming in from an SQL database and is defined as numeric, length of 5, precision of 7 and scale of 4. Basically if the field contains .1244, then I need to display 12.44%.

I am getting the following error:

Microsoft VBScript runtime error '800a000d'
Type mismatch


Any ideas?

Thanks in advance,

George

I *think* you get a SQL NULL value from your db. Lookup the IsNull() function in the VBScript Docs for explanations and sample code. I tried this

  vVal = 1 / 3
  WScript.Echo FormatPercent( vVal, 2 )
  vVal = Null
  WScript.Echo FormatPercent( vVal, 2 )

to verify that the last line does indeed raise a Type mismatch
error.
.



Relevant Pages

  • Re: very very very very urgent and important
    ... At first it seemed to work fine in SeaMonkey 1.0.5, but when entering the secure area this message occoured: ... "Microsoft VBScript runtime error '800a000d' ... Type mismatch: 'ubound' ...
    (comp.sys.mac.apps)
  • Re: Delphi 2006 announced
    ... but their websites obviously as good as their thoughts as it told me Microsoft VBScript runtime error '800a000d' Type mismatch: 'CLng' /opinion/post_message.asp, ...
    (borland.public.delphi.non-technical)
  • Microsoft VBScript runtime error
    ... saying: Microsoft VBScript runtime error '800a000d' Type mismatch: ...
    (microsoft.public.win2000.general)
  • Re: formatnumber function returns error
    ... > Microsoft VBScript runtime error '800a000d' ... > Type mismatch: 'formatNumber' ...
    (microsoft.public.inetserver.asp.general)
  • Re: Format Percent
    ... > George wrote: ... >> Microsoft VBScript runtime error '800a000d' ... > WScript.Echo FormatPercent(vVal, 2) ... > to verify that the last line does indeed raise a Type mismatch ...
    (microsoft.public.scripting.vbscript)