Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT woh.WorksOrderNumber
, woh.DateTimeCreated AS [WO Created]
, woh.TotalVolumeIn
, woh.TotalVolumeOut
, CAST(ROUND(woh.TotalVolumeIn - woh.TotalVolumeOut, 4) AS numeric(36, 4)) AS Difference
FROM dbo.WorksOrderHeader woh
INNER JOIN dbo.Users users
ON woh.CreatedByID = dbo.Users.UserID
WHERE (users.UserID = 125)
AND (CAST(ROUND(woh.TotalVolumeIn - woh.TotalVolumeOut, 4) AS numeric(36, 4)) > 0.1
OR CAST(ROUND(woh.TotalVolumeIn - woh.TotalVolumeOut, 4) AS numeric(36, 4)) < -0.1
)
AND (woh.DateTimeCreated = CONVERT(varchar(19), GETDATE() - 1, 6))
ORDER BY woh.DateTimeCreated
SELECT woh.WorksOrderNumber
, woh.DateTimeCreated AS [WO Created]
, woh.TotalVolumeIn
, woh.TotalVolumeOut
, diff.Difference
FROM dbo.WorksOrderHeader woh
INNER JOIN dbo.Users users
ON woh.CreatedByID = dbo.Users.UserID
outder apply (select CAST(ROUND(woh.TotalVolumeIn - woh.TotalVolumeOut, 4) AS numeric(36, 4)) AS Difference ) diff
WHERE (users.UserID = 125)
AND (diff.Difference > 0.1
OR diff.Difference < -0.1
)
AND (woh.DateTimeCreated = CONVERT(varchar(19), GETDATE() - 1, 6))
ORDER BY woh.DateTimeCreated
Select Round(1.2345678, 4)