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 |
|
markinnes74
Starting Member
2 Posts |
Posted - 2009-08-24 : 09:03:06
|
| Hi,I am trying select the current system time in just hours and minutes then subtract 5 hours from this.I am using select CONVERT(nvarchar(5), CURRENT_TIMESTAMP ,8) to get the current time without date but when trying to subtract it falls over.Any idea's please?thanksMark |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-24 : 09:08:26
|
| SELECT CONVERT(NVARCHAR(5), DATEADD(HOUR,-5,CURRENT_TIMESTAMP) ,8)MadhivananFailing to plan is Planning to fail |
 |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-08-24 : 09:08:35
|
| select convert(varchar(5), DATEADD(hh, -5, getdate()), 114) |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-24 : 09:11:09
|
select convert(nvarchar(5),dateadd(hour,-5,CURRENT_TIMESTAMP) ,8) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-24 : 09:11:45
|
Argh!Double sniped No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
markinnes74
Starting Member
2 Posts |
Posted - 2009-08-24 : 10:37:49
|
| thank you. they worked. |
 |
|
|
|
|
|
|
|