SELECT SlNo, SiteID, OnTime, DueTime, (OnTime * 100.0) / NULLIF (Max(OnTime) OVER (), 0) Percentage1, (DueTime * 100.0) / NULLIF (Max(OnTime) OVER (), 0) Percentage2 FROM tbl_Per
--data setup declare @percent numeric(12,8); set @percent = 34.3452344; --query select convert(decimal(12,3), @percent) percentage; --result --34.345
ROUND
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)