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
 SQL Server Development (2000)
 Sql Datetime

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-10 : 07:40:41
Indrantn writes "Please can someone help, I am working with datetime value that I need to set the time part of the variable to a specifc time, but leave the date part unchanged."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-10 : 08:01:19
[code]Declare @d datetime
set @d=getdate()
select @d
select @d=dateAdd(dd,datediff(dd,0,getdate()),0) + '10:10:00'
Select @d
[/code]

Madhivanan

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

- Advertisement -