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 2000 Forums
 Transact-SQL (2000)
 Convert function

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-08 : 11:58:08
Tushar writes "How to display data between two dates?
From date is Jan/2000 and to date is mmddyyyy passion
How to convert jan/2000 in datetime datatype"

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-08 : 12:16:57
[code]
declare @date varchar(20)
declare @date1 datetime
set @date = 'jan/2000'
select @date,
replace(@date, '/', ' '),
cast(replace(@date, '/', ' ') as datetime)
select @date1 = cast(replace(@date, '/', ' ') as datetime)
select @date1
[/code]

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -