→ The Lansweeper Customer Excellence Awards 2024 - Submit Your Project Now! Learn More & Enter Here
‎09-03-2016 06:31 PM
Solved! Go to Solution.
‎09-06-2016 01:56 PM
‎01-03-2019 11:16 PM
DateAdd(YEAR, -x, tblAssetCustom.Warrantydate) As [Purchase Date]
Cast(DateDiff(dd, (DateAdd(YEAR, -x, tblAssetCustom.Warrantydate)),
GetDate()) / 365.2425 As numeric(8,1)) As [Age (Years)]
‎09-06-2019 08:54 PM
ryanjd93 wrote:
Had to get creative, but this should work to get the purchase date, if and only if the warranty date is already populated, the warranty date minus x is the true purchase date, and x = number of years the warranty is good for.
DateAdd(YEAR, -x, tblAssetCustom.Warrantydate) As [Purchase Date]
And to put it in a year format, you can do this:
Cast(DateDiff(dd, (DateAdd(YEAR, -x, tblAssetCustom.Warrantydate)),
GetDate()) / 365.2425 As numeric(8,1)) As [Age (Years)]
Hopefully this helps someone.
‎09-09-2019 02:32 PM
Doug Addison wrote:ryanjd93 wrote:
Had to get creative, but this should work to get the purchase date, if and only if the warranty date is already populated, the warranty date minus x is the true purchase date, and x = number of years the warranty is good for.
DateAdd(YEAR, -x, tblAssetCustom.Warrantydate) As [Purchase Date]
And to put it in a year format, you can do this:
Cast(DateDiff(dd, (DateAdd(YEAR, -x, tblAssetCustom.Warrantydate)),
GetDate()) / 365.2425 As numeric(8,1)) As [Age (Years)]
Hopefully this helps someone.
Is this a SQL query you are running on the database or in the report builder? I ma trying to get the purchase date info for all of the Lenovo's the company has as well. Our Dells of course auto populate the purchase date.
‎01-03-2019 08:52 PM
‎01-16-2018 04:49 PM
‎01-11-2018 04:01 PM
‎01-10-2018 06:51 PM
‎09-06-2016 01:56 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now