Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to create script to convert numeric into date

Author  Topic 

rhsalim
Starting Member

3 Posts

Posted - 2008-10-15 : 08:15:48
Please help me, how to convert numeric into datetime using script...

RHS

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-15 : 08:19:12
What do the numeric value look like?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-10-15 : 08:19:53
moved from script library.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

rhsalim
Starting Member

3 Posts

Posted - 2008-10-15 : 08:56:49
quote:
Originally posted by Peso

What do the numeric value look like?



E 12°55'05.63"
N 56°04'39.26"




the numeric look like '20080915'

RHS
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 08:59:48

select cast(col as datetime) from table
where isdate(col)=1 and len(col)=8

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 09:01:26
and see why you need to check number of digits
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/09/24/handle-isdate-with-care.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rhsalim
Starting Member

3 Posts

Posted - 2008-10-15 : 09:17:35
quote:
Originally posted by Peso

What do the numeric value look like?



E 12°55'05.63"
N 56°04'39.26"




i mean, how convert it using script component...

RHS
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 09:19:44
quote:
Originally posted by rhsalim

quote:
Originally posted by Peso

What do the numeric value look like?



E 12°55'05.63"
N 56°04'39.26"




i mean, how convert it using script component...

RHS


Waht do you mean by script component?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-15 : 09:31:10
quote:
Originally posted by rhsalim

quote:
Originally posted by Peso

What do the numeric value look like?



E 12°55'05.63"
N 56°04'39.26"




i mean, how convert it using script component...

RHS


why do you need script component? You can use data type conversion task for this. But make sure you've only numeric values coming.
Go to Top of Page
   

- Advertisement -