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)
 Expression,Conv/Cast DataType Int to String & Date

Author  Topic 

ismailc
Constraint Violating Yak Guru

290 Posts

Posted - 2007-08-22 : 10:12:45
Hi, Expression Builder

I need help converting/casting a SQL column Data Type of Int to type: String & Date
Data Example

From Int Column: 20070131

To String:
20070131

2007/01/31

2007.01

To Date:
2007/01/31 00:00:00

Does anyone have any examples, i need to do it via an expression.

Regards,

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-08-22 : 10:18:30
use convert()

Refer to BOL for further detail http://msdn2.microsoft.com/en-us/library/ms187928.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ismailc
Constraint Violating Yak Guru

290 Posts

Posted - 2007-08-23 : 07:06:44
A big Thank You!!!

quote:
Originally posted by khtan

use convert()

Refer to BOL for further detail http://msdn2.microsoft.com/en-us/library/ms187928.aspx


KH
[spoiler]Time is always against us[/spoiler]



Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-23 : 07:19:41
Or this very recent topic
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=88267



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -