[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

How to convert float value in Varachar

Dear Experts,
I have a table structure is as follows:
CREATE TABLE [dbo].[Text1](
      [TransNo] [float] NULL,
      [SupInv] [float] NULL,
      [OrderNo] [float] NULL
) ON [PRIMARY]

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)
0
Mehram
Asked:
Mehram
1 Solution
 
jorge_torizCommented:
DECLARE @Value VARCHAR(50)
DECLARE @Float FLOAT

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

SELECT @Value
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now