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 |
|
nibbio
Starting Member
2 Posts |
Posted - 2011-09-09 : 04:35:54
|
| HelloI have a table where "IntervalStartDateTime" is in UTC. I need to create a wiew showing "intervalDateTime" in local time, because i'm UTC+2.Thanks in advanceFollow my query:SELECT TOP (100) PERCENT VDNStatsId, IntervalType, IntervalStartDateTime, IntervalEndDateTime, SwitchId, VDNDeviceId, VDNName, CallsTotal, CallsFlowOut, CallsAnswered, CallsAbandoned, CallsCompleted, CallsWaiting, CallsHolding, LongestWaitingSeconds, LongestIntervalWaitingSeconds, TotalTalkSeconds, TotalWaitSeconds, TotalHoldSeconds, TotalAbandonedSeconds, ShiftNumber, ServiceLevel, ServiceLevelSeconds, ServiceLevelChangedFROM dbo.VDNStatsWHERE (VDNDeviceId IN (N'9807192', N'9807193', N'9807340'))ORDER BY IntervalStartDateTime |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-09 : 07:55:34
|
| just do like DATEADD(hh,DATEDIFF(hh,GETUTCDATE(),GETDATE()),IntervalStartDateTime) as LocalIntervalStartDateTime------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
nibbio
Starting Member
2 Posts |
Posted - 2011-09-12 : 03:28:09
|
| Works very fineThank you! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-12 : 04:10:56
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|