Avatar of maximus1974
maximus1974

asked on 

How to count the amount of days from a date in the past

I want to show the amount of days a product has been in our possession since received(dbo.WOMAST01B.recdate) to today's date. I want to show this count in a column named "Days Left". Any help will be appreciated.

SELECT     dbo.WOMAST01B.step, dbo.WOMAST01B.wono AS WO, dbo.WOMAST01B.item AS PN, dbo.WOMAST01B.location, dbo.WOMAST01B.dept AS SHOP, 
                      dbo.WOMAST01B.location2 AS [ASSIGNED EMPLOYEE], dbo.WOLABO01B.prempl, dbo.WOLABO01B.time, dbo.WOMAST01B.recdate AS [DAYS LEFT]
FROM         dbo.WOMAST01B LEFT OUTER JOIN
                      dbo.WOLABO01B ON dbo.WOMAST01B.wono = dbo.WOLABO01B.wono
WHERE     (dbo.WOMAST01B.dept = 'AVI')

Open in new window

Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008SQL

Avatar of undefined
Last Comment
zephyr_hex (Megan)

8/22/2022 - Mon