August 31, 2008 at 10:17 pm
Hi
i am using sql server to convert data type.here critical is my source data column
studentno nvarchar(50) i have been trying this to convert "Bigint" data type but it shows
error.tell me which datatype is sutible for my column studentno
here my data is
studentno nvarchar(50)
-----------
2.00701E+16
2.00706E+16
2.00806E+16
2.00712E+16
2.00703E+16
but i want output like this
2007010000000000
2007060000000000
2008060000000000
2007120000000000
2007030000000000
thanks
murali
September 1, 2008 at 4:54 am
You will need to cast to a float first.
SELECT CAST(CAST(N'2.00701E+16' AS float) AS bigint)
September 1, 2008 at 6:11 am
Thanks Ken
its working
and what is 'N' here
Thanks
murali
September 1, 2008 at 6:21 am
The 'N' just means a nchar constant as opposed to a char constant.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply