cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
2jk7860
Visitor Sweeper

I'd like to create a custom report for assets that have a date filled into our tblassetcustom.Custom1 field but are older than 2 weeks from today's date. 

My current query is as follows but it returns a listing of assets I would expect and assets that don't have anything in that field at all. I've tried doing not null for the criteria but that doesn't help. How do I query that custom date field to only show items older than 2 weeks from today's date and ignore those assets that don't have anything in that custom field? Thanks in advance for any help you can offer!!

Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tblassets.IPAddress,
tblassets.Lastseen,
tblassets.Lasttried,
tblassetcustom.Custom1
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Where tblassetcustom.Custom1 < DateAdd(week, -2, GetDate())

0 REPLIES 0