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 convert datetime string into datetime forma

Author  Topic 

pmotewar
Yak Posting Veteran

62 Posts

Posted - 2009-08-03 : 03:33:51
Hi All,

i want to convert the following date string into datetime formate


'25/07/2008' --- dd/mm/yyyy

i want to convert it into datetime format how can i do it.

please help me .

Pankaj

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-08-03 : 03:36:02
use convert() with style 103

convert(datetime, '25/07/2008', 103)



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

Go to Top of Page

pmotewar
Yak Posting Veteran

62 Posts

Posted - 2009-08-03 : 03:39:57
Thanks dude

quote:
Originally posted by khtan

use convert() with style 103

convert(datetime, '25/07/2008', 103)



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





Pankaj
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-08-03 : 04:46:44
see these link for conversion of datetime in different formats
http://www.sql-server-helper.com/tips/date-formats.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80563
Go to Top of Page
   

- Advertisement -