
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2013 12:43 AM
Complete SQL newb here. I have the below report, and I want to know when Custom07 is "blank"/has no data. Need to narrow down my assets and make sure these blanks are filled in. Thanks!
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tsysAssetTypes.AssetType,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Description,
tblAssetCustom.Comments,
tblAssetCustom.Custom1 As [Invoice Date],
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAssetCustom.Department,
tblAssetCustom.Location,
tblAssetCustom.OrderNumber,
tblAssetCustom.Custom2 As Vendor,
tblAssetCustom.Custom3 As [P/O #],
tblAssetCustom.Custom4 As [Invoice #],
tblAssetCustom.Custom10 As [Invoice URL],
tblAssetCustom.Custom5 As [Payment Type],
tblAssetCustom.Custom6 As [Invoice Total],
tblAssetCustom.Custom7 As [Price Per Unit],
tblAssetCustom.Custom8 As [Original Assigned User],
tblAssets.Username As [Last User Logon],
tblAssetCustom.Custom9 As [Associated PC],
tblAssetCustom.State,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tsysAssetTypes.AssetType Not In (0, 200)
Solved! Go to Solution.
Labels:
- Labels:
-
Report Center
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2013 01:46 AM
Rethinking it, if you really want to cover your bases, you should probably allow for spaces having been entered and trim them before checking for an empty string.
WHERE tsysAssetTypes.AssetType NOT IN (0, 200)
AND ( (tblAssetCustom.Custom7 IS NULL)
OR (RTrim(tblAssetCustom.Custom7) = '')
)
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2013 01:46 AM
Rethinking it, if you really want to cover your bases, you should probably allow for spaces having been entered and trim them before checking for an empty string.
WHERE tsysAssetTypes.AssetType NOT IN (0, 200)
AND ( (tblAssetCustom.Custom7 IS NULL)
OR (RTrim(tblAssetCustom.Custom7) = '')
)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2013 01:49 AM
I'm learning already! 🙂 going to keep that in my notes for other "fill in the blank" reports that I need to do 🙂
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2013 01:24 AM
Like this?
WHERE tsysAssetTypes.AssetType NOT IN (0, 200)
AND ( (tblAssetCustom.Custom7 IS NULL)
OR (tblAssetCustom.Custom7 = '')
)
