Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. SQL Typecasting

SQL Typecasting

Scheduled Pinned Locked Moved ASP.NET
databasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xavier Shay
    wrote on last edited by
    #1

    Is it possible? I need to typecast a string to number and then use a "<" comparison. Any ideas? - Xavier

    S 1 Reply Last reply
    0
    • X Xavier Shay

      Is it possible? I need to typecast a string to number and then use a "<" comparison. Any ideas? - Xavier

      S Offline
      S Offline
      Scott Hernandez
      wrote on last edited by
      #2

      Yes it is possible. But, this will be a very costly calculation depending on the query and number of rows affected. http://msdn.microsoft.com/library/en-us/acdata/ac\_8\_con\_03\_7uzy.asp?frame=true CAST (textField AS int) I assume you want to do something like this: select * from table where cast(column as int) > 4

      X 1 Reply Last reply
      0
      • S Scott Hernandez

        Yes it is possible. But, this will be a very costly calculation depending on the query and number of rows affected. http://msdn.microsoft.com/library/en-us/acdata/ac\_8\_con\_03\_7uzy.asp?frame=true CAST (textField AS int) I assume you want to do something like this: select * from table where cast(column as int) > 4

        X Offline
        X Offline
        Xavier Shay
        wrote on last edited by
        #3

        This would have worked but for the fact that not every field can be converted to an int, meaning Access throws an error. I think I might just have to redesign this part of the database. - Xavier

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups