
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 05:38 PM
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
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
Labels:
- Labels:
-
General Discussion
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 07:18 PM
I had to add an AS Days at the end but it did work.
Thank you.
Thank you.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 06:33 PM
See the DateDiff() function.
DateDiff(d, tblAssetCustom.PurchaseDate,tblAssetCustom.Warrantydate)should give you what you're after.
