Re: changing txt to number

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Jeff" wrote in message news:JuKdnRA3MujknfrfRVn-qw@xxxxxxxxxxxxxxx
:I am using access DB.
: i have a large table that i have aquired, and all the data in the fields
are
: actually txt. unfortunatly, the data is integers stored as txt. the future
: plan, is to redo the DB, and make the fields numeric, but for now, i need
a
: way to retrieve data, and change it to numeric.
:
: so if field cc_callNumbers is a 7.. but the field type is txt, in my asp
: page i can call that as say
:
: var1 = sales_data.fields.item("cc_callNumbers").value
:
: that value returns a txt 7, but i need to convert it to a number 7, so i
can
: do math with the data. is this possible?

As Ray said....

var1 = CInt(sales_data.fields.item("cc_callNumbers").value)

To verify:

Response.Write typename(var1)

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


.



Relevant Pages

  • Re: objFSO.FileExists not working?????
    ... "Roland Hall" wrote in message ... without even the implied warranty of merchantability ... or fitness for a particular purpose. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Checked checkboxes
    ... :> Roland Hall ... support for .getElementsByName() is inconsistent at best. ... In vbscript, while loops can exit ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: Parse error message - repeat under managed account
    ... > Explorer and worms that all files should be shown by default? ... > .vb one and there is another beneath that, .resx, which I assume is a ... > Roland Hall ... without even the implied warranty of merchantability ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Check Date Function :-S
    ... :>"Dr John Stockton" wrote in message ... Roland Hall ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: Some pcs cant view my web site if behind ISA
    ... Most people can see my website which is running windows ... :> Default on the client is port 80, no matter what your web site uses. ... :> Roland Hall ... without even the implied warranty of merchantability ...
    (microsoft.public.isa)