Convert text number to a number in a MS Access.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Convert text number to a number in a MS Access.

  1. #1
    James Guest

    Convert text number to a number in a MS Access.


    Does anyone know how to convert a text string that represents a number
    to a number in a MS Access query. I'm using 2000 in an NT environment.

    Thanks in advance for any help.

    James

  2. #2
    Joe \Nuke Me Xemu\ Foster Guest

    Re: Convert text number to a number in a MS Access.

    "James" <tbt102@hotmail.com> wrote in message <news:3b3d106c$1@news.devx.com>...

    > Does anyone know how to convert a text string that represents a number
    > to a number in a MS Access query. I'm using 2000 in an NT environment.


    If you're talking about turning "500" into 500, check out Val, CDbl,
    CInt, CCur, CDec, and other conversion functions. Or are you talking
    about converting strings such as "five hundred" to 500?

    --
    Joe Foster <mailto:jfoster@ricochet.net> Got Thetans? <http://www.xenu.net/>
    WARNING: I cannot be held responsible for the above They're coming to
    because my cats have apparently learned to type. take me away, ha ha!



  3. #3
    James Guest

    Re: Convert text number to a number in a MS Access.


    I'm talking about turning "500" into 500

    I'll try the functions you listed in your posting. Thanks.


    "Joe \"Nuke Me Xemu\" Foster" <joe@bftsi0.UUCP> wrote:
    >"James" <tbt102@hotmail.com> wrote in message <news:3b3d106c$1@news.devx.com>...
    >
    >> Does anyone know how to convert a text string that represents a number
    >> to a number in a MS Access query. I'm using 2000 in an NT environment.

    >
    >If you're talking about turning "500" into 500, check out Val, CDbl,
    >CInt, CCur, CDec, and other conversion functions. Or are you talking
    >about converting strings such as "five hundred" to 500?
    >
    >--
    >Joe Foster <mailto:jfoster@ricochet.net> Got Thetans? <http://www.xenu.net/>
    >WARNING: I cannot be held responsible for the above They're coming

    to
    >because my cats have apparently learned to type. take me away,

    ha ha!
    >
    >



  4. #4
    Zack_NYC Guest

    Re: Convert text number to a number in a MS Access.


    "James" <tbt102@hotmail.com> wrote:
    >
    >Does anyone know how to convert a text string that represents a number
    >to a number in a MS Access query. I'm using 2000 in an NT environment.
    >
    >Thanks in advance for any help.
    >
    >James

    Hi, James
    Here is the answer:

    This example uses the Val function to return the numbers contained in a string.

    Dim MyValue
    MyValue = Val("2457") ' Returns 2457.
    MyValue = Val(" 2 45 7") ' Returns 2457.
    MyValue = Val("24 and 57") ' Returns 24.

    Let me know if you need anything else.
    Best
    Zack_NYC


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center