How to convert float value in Varachar

Posted on 2009-12-22
Last Modified: 2012-05-08
Dear Experts,
I have a table structure is as follows:
CREATE TABLE [dbo].[Text1](
      [TransNo] [float] NULL,
      [SupInv] [float] NULL,
      [OrderNo] [float] NULL

Data which is in the text1 table is 100% correct & I need to update SupInv & OrderNo from Text1 table to into real table with the help of join Transno. Statement As follows:
Update b Set SupInvoiceNo=a.SupInv, OrderNo=b.OrderNo
from Text1 a join Tankers b on a.transno=b.transno

The statement is running successfully, but the data is showing in real table after update like 1.23823e+007 & 1.23824e+007. Please help how to fix this problem.

Please note in real table SupInocieNo & OrderID is varchar(50)
Question by:Mehram
    1 Comment
    LVL 15

    Accepted Solution

    DECLARE @Value VARCHAR(50)

    SET @Float = 18267460000000
    SET @Value = CAST(@Float AS DECIMAL(15,0))

    SELECT @Value

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now