
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2016 10:18 PM
Simple query, unexpected result. I am using the second Custom2 field to save Cost, since Lansweeper is about the only inventory system in the world without a field for it
Trying to see something over the cost of $500
And the result set I get is wrong. I get items well under the amount.
The column appears to be formatted as nvarchar which would explain why this doesn't work.
If I were to change this column type to numeric, am I going to blow up Lansweeper?

Trying to see something over the cost of $500
SELECT a.AssetName, at.AssetTypename, ac.PurchaseDate, ac.Department, ac.Custom2 FROM tblAssets a
INNER JOIN tblAssetCustom ac ON a.AssetID = ac.AssetID
INNER JOIN tsysAssetTypes at ON a.Assettype = at.AssetType
WHERE ac.Custom2 > '499'
And the result set I get is wrong. I get items well under the amount.
The column appears to be formatted as nvarchar which would explain why this doesn't work.
If I were to change this column type to numeric, am I going to blow up Lansweeper?
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
‎03-05-2016 12:40 PM
You will need to convert the values in your query, as suggested by RC62N as well. Custom fields always remain text fields within the Lansweeper database, regardless of what you set their display type to. Changing the field type directly in the database is not supported and may very well break certain parts of your installation.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2016 12:40 PM
You will need to convert the values in your query, as suggested by RC62N as well. Custom fields always remain text fields within the Lansweeper database, regardless of what you set their display type to. Changing the field type directly in the database is not supported and may very well break certain parts of your installation.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 04:49 PM
That would absolutely work, but will have to do that on any query that uses the custom fields. Seems like when you change the type of data in the column, Lansweeper should be formatting that column as such instead of leaving as nvarchar
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2016 11:12 PM
Rather than risk breaking your LANSweeper, could you not Convert() your custom value to an Int when evaluating it?
