cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mmeetze
Engaged Sweeper III
Right Now when I try to include the current state of the asset, I get one of two error messages, either that it cannot convert the state "Active" to the data type int, or it will just return results that have the same device repeated with each available state option. This is the query i am using to get the error that it cannot convert the data type for the Active state:

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tblAssets.Memory,
tblAssetCustom.Serialnumber,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.OScode,
tblOperatingsystem.OSID,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Description,
tblADComputers.OU,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblOperatingsystem.Version,
tblState.Statename
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblState On tblAssetCustom.State = tblState.Statename
Where tblADComputers.OU Like 'OU=Inventory%'
1 REPLY 1
David_G
Lansweeper Employee
Lansweeper Employee
I presume that you tried to fill in the 'Active' state for tblAssetCustom.State. This field only allows for int data types, i.e. a number. In case of 'Active' this is '1'. However, as you have already added the database table tblState, it is easier to filter on tblState.Statename, as this will filter on the name of the asset state, in this case 'Active' as seen in the report below. Instructions for adding this report to your Lansweeper installation can be found here. If you are interested in building or modifying reports, we do recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tblAssets.Memory,
tblAssetCustom.Serialnumber,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.OScode,
tblOperatingsystem.OSID,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Description,
tblADComputers.OU,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblOperatingsystem.Version,
tblState.Statename
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblState On tblAssetCustom.State = tblState.Statename
Where tblADComputers.OU Like 'OU=Inventory%' And tblState.Statename = 'Active'