Type Mismatch using Format()

  • Thread starter Catherine Lynn Smith
  • Start date
C

Catherine Lynn Smith

OK, newbie here - I am trying to figure how how in the heck I can use
the Format command to pre-format integers to display a fixed length
supplimenting leading zeros when needed.

According to the RTFM rigors I have been going through all morning, I
just give Format an expression with the first value being either
numeric or string. But when I try either it spits out a type mismatch
error. I have tried it with the recordset from the SQL, with a local
variable and with a constant value in both string and numeric. I have
tried using various type conversions like CDec or CInt or CStr - I
keep getting the same error. I have tried removing all the optional
parameters and just giving it a value like:

Format(123)

or

Format("123")

I am beginning to realize why I avoided microsoft languages and
platforms for so long - I am about to TTFM (throw the fekkin manual)

Help!

Kathy Lynn
 
A

Aaron Bertrand - MVP

Correct, VBScript is more or less a subset of Visual Basic.

http://tech.irt.org/articles/js117/

http://www.soldierx.com/books/Teach Yourself VBScript in 21 Days/ch20.htm




Catherine Lynn Smith said:
There is no format() in VBScript. For padding integers, see
http://www.aspfaq.com/2300

oh - hmmm

Then perhaps I am more newbie then I thought - I did a web search on
google for '"visual basic" asp "format function"' and found the
following link. So VBScript does 'not' inherit all visual basic
functions?

http://msdn.microsoft.com/library/d...n-us/vbcn7/html/vaconformatchangesinvbnet.asp

KL[/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top