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. Database & SysAdmin
  3. Database
  4. convert

convert

Scheduled Pinned Locked Moved Database
databasetutorial
6 Posts 6 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.
  • T Offline
    T Offline
    trilokharry
    wrote on last edited by
    #1

    select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

    You get the best out of others when you give the best of yourself.

    J K A M N 5 Replies Last reply
    0
    • T trilokharry

      select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

      You get the best out of others when you give the best of yourself.

      J Offline
      J Offline
      joemonvarghese80 yahoo co in
      wrote on last edited by
      #2

      hi You can use Convert function for this. like select convert(varchar,Intvalue)+varcharvalue from table. Regards Joe

      1 Reply Last reply
      0
      • T trilokharry

        select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

        You get the best out of others when you give the best of yourself.

        K Offline
        K Offline
        Krish KP
        wrote on last edited by
        #3

        Use Convert or Cast functions

        SELECT Convert(VarChar(10), IntValue) + VarcharValue .....

        SELECT Cast(IntValue, VarChar(10)) + VarcharValue .....

        in the example I've used 10 characters i.e. max 10 degit number

        Regards KP

        1 Reply Last reply
        0
        • T trilokharry

          select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

          You get the best out of others when you give the best of yourself.

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          Try using SQL Books Online rather than putting .NET code into sql statements and expecting them to work.

          Bob Ashfield Consultants Ltd

          1 Reply Last reply
          0
          • T trilokharry

            select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

            You get the best out of others when you give the best of yourself.

            M Offline
            M Offline
            Mike Dimmick
            wrote on last edited by
            #5

            Generally I return just the data from SQL Server and perform any formatting necessary in the 'client' code (i.e. the code that called into SQL Server).

            DoEvents: Generating unexpected recursion since 1991

            1 Reply Last reply
            0
            • T trilokharry

              select IntValue+VarcharValue from tbl but it's not possible so how to convert IntValue in varchar in query only like select convert.tostring(IntValue)+VarcharValue from tbl what can I do despite of convert.toString because convert.Tostring wrong thanks

              You get the best out of others when you give the best of yourself.

              N Offline
              N Offline
              Niraj_Silver
              wrote on last edited by
              #6

              Hi... Try This One Will Work Select Convert(varChar(20), Role) + LogInID From LogIn By Take Care.. :)

              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