Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. SELECT @APower24Cell = AVG((CAST(ACurrent24Cell as FLOAT)*CAST(AVoltage3Sec as FLOAT))/10)/1000 ,
  2. @BPower24Cell = AVG((CAST(BCurrent24Cell as FLOAT)*CAST(BVoltage3Sec as FLOAT))/10)/1000 ,
  3. @CPower24Cell = AVG((CAST(CCurrent24Cell as FLOAT)*CAST(CVoltage3Sec as FLOAT))/10)/1000 ,
  4. @APower35Cell = AVG((CAST(ACurrent35Cell as FLOAT)*CAST(AVoltage3Sec as FLOAT))/10)/1000 ,
  5. @BPower35Cell = AVG((CAST(BCurrent35Cell as FLOAT)*CAST(BVoltage3Sec as FLOAT))/10)/1000 ,
  6. @CPower35Cell = AVG((CAST(CCurrent35Cell as FLOAT)*CAST(CVoltage3Sec as FLOAT))/10)/1000
  7. FROM Energomonitoring
  8. WHERE TS >= DATEADD(HOUR,-24,GETDATE()) GROUP BY TS
  9.  
  10. SET @FULLPOWER = (@APower24Cell+@BPower24Cell+@CPower24Cell+@APower35Cell+@BPower35Cell+@CPower35Cell) * DATEDIFF(hour, dateadd(hour, datepart(hour,GETDATE()),CAST(convert(varchar(20),getdate(),112) as datetime)), GETDATE())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement