cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AM13337
Engaged Sweeper III
I would like to calculate the days between Purchase Date and Warranty Date.

Can anybody help me please.

Select Top 1000000 tsysOS.Image As icon,
tblAssetCustom.BarCode As [Asset ID #],
tblAssets.AssetID,
tblAssets.AssetName,
tblAssetCustom.Location,
tblADusers.Displayname As Username,
tblADusers.Department As [User Department],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Custom1 As [Purchase Price],
tblAssetCustom.Serialnumber,
tblAssetCustom.Custom2 As [Checked Date],
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate
From tblAssets
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblComputersystem.Domainrole < 2 And tblComputersystem.PartOfDomain = 1
And tblAssetCustom.State = 1
Order By tblAssets.AssetName
2 REPLIES 2
AM13337
Engaged Sweeper III
I had to add an AS Days at the end but it did work.

Thank you.
RCorbeil
Honored Sweeper II
See the DateDiff() function.
DateDiff(d, tblAssetCustom.PurchaseDate,tblAssetCustom.Warrantydate)
should give you what you're after.