Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
How can I get the next information hh:mm:ss in a char var of the getdate() function?
Tahsin
Starting Member
34 Posts
Posted - 2006-03-08 : 15:43:55
What exactly do you mean by the "next information"?
Tahsin
Starting Member
34 Posts
Posted - 2006-03-08 : 15:49:55
See if this is what you are looking for:
SELECT RTRIM(CAST(DATEPART(hour, getdate()) AS CHAR))+ ':' + RTRIM(CAST(DATEPART(minute, getdate()) AS CHAR)) + ':' + RTRIM(CAST(DATEPART(second, getdate()) AS CHAR))
- Tahsin
shifis
Posting Yak Master
157 Posts
Posted - 2006-03-08 : 16:42:07
Thanks, you undestand what I mean, sorry but sometimes my English is terrible.Another question how can I obtain for example 14:39:00 insead of14:39:0?How can I do that always the hh, mm and second have 2 digits?