June 25, 2012 at 11:06 am
I am replacing my "end date" to getdate () when it is null.Something like below
isnull(temp.end_time,GETDATE()) as Analysis_time
but my "start date" and end time is in EST conversion. And when there is null I am getting the getdate() in CST, where as I want the getdate to be also in EST.
How can we replace it??
can we do it like this??
isnull(temp.end_time,datediff("HH",-6,GETDATE()))
June 25, 2012 at 11:09 am
Central time is one hour behind Eastern time, why not just add an hour to getdate()?
June 25, 2012 at 11:10 am
There are options beyond GetDate that may be more appropriate. Check here: http://msdn.microsoft.com/en-us/library/ms188383.aspx
Some of them include the time offset from UTC, so you can easily use those for EST/CST/EDT/CDT/Arizona-time/etc.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 25, 2012 at 12:25 pm
Thank you so much..this would help!!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply