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)
 SEt @Time Parameter to 06:00

Author  Topic 

LarryC74
Yak Posting Veteran

94 Posts

Posted - 2011-06-21 : 20:23:50
Hey guys,
I have a stored procedure that uses the below code.

set @To = cast(datediff(day, 0, GetDate())as datetime);
set @From = dateadd(d, -1, @To);

I need to have the date go from 06:00am to 06:ooam and NOT midnight to midnight.

I can't seem to add the 06:00 to the @To parameter.

How do I add/convert that so I have the date + time?

Larry

Everyday life brings me back to reality

LarryC74
Yak Posting Veteran

94 Posts

Posted - 2011-06-21 : 20:27:49
I think I have it...I had the '06:00' before the last parenthesis, but if I put after it it seems to work

Everyday life brings me back to reality
Go to Top of Page
   

- Advertisement -