根据UTC时间查询当前时间 有个tbA
id utcTime
1 XX
2 XX
我想要的把每一行的utc时间转换成对应的本地时间
方法已经有了
DECLARE @LocalDate DATETIME,
@UTCDate DATETIME;
SET @UTCDate =(select [utcTime] from [Nop_Customer]);
SET @LocalDate = DATEADD(hour, DATEDIFF(hour,GETUTCDATE(),GETDATE()), @UTCDate) ;
select id ,@LocalDate as localDT from tbA
这样的话SET @UTCDate =(select [utcTime] from [Nop_Customer]); 这里会报错
请问怎么改