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.
Author |
Topic |
robnjay
Starting Member
14 Posts |
Posted - 2012-09-20 : 10:27:09
|
I need to select records from a field which has times like06:05:59I need to select only the hours and add ":00:00" to it, so my query retrieves06:00:00I am using SQL Server 2000In another SQL (not SQL Server), I had a FORMAT, so I could do:CAST([Date] as CHAR FORMAT 'DD-MON-YY HH:00:00') as TheTimeHow do I do this in SQL Server 2000? I don't think I can use the canned formatting numbers in this case...Edit: I now realize this should have been in another area of the forum, can't figure out how to move it to the SQL Server 2000 Transact SQL area...Thanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-09-20 : 10:57:14
|
[code]select convert(varchar(3), getdate(), 108) + '00:00'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|