You don't have a relationship between
tblEncryptableVolume and
tblFloppy. You can't, in fact, as they're recording two different things:
tblFloppy is a record of the physical characteristics of the drive while
tblEncryptableVolume is a record of volume (not drive) drive letters and their encryption status.
Depending on what you want/need, you might try using
tblDiskDrives instead of
tblFloppy.
tblFloppy offers physical characteristics of the
drives: model, serial, partitions, size, etc.
tblDiskDrives, despite what the table name suggests, offers
volume information rather than drive information.
No guarantees this is what you're after, but hopefully it helps guide you in.
Select Top 1000000 tsysAssetTypes.AssetTypeIcon16 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblEncryptableVolume.DriveLetter,
Case
When tblEncryptableVolume.ProtectionStatus = 0 Then 'OFF'
When tblEncryptableVolume.ProtectionStatus = 1 Then 'ON'
Else 'UNKNOWN'
End As ProtectionStatus,
tblDiskDrives.FileSystem,
tblDiskDrives.VolumeName,
tblDiskDrives.VolumeSerialNumber,
tblDiskDrives.Size,
tblDiskDrives.FreeSpace,
tblEncryptableVolume.LastChanged,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblEncryptableVolume
Inner Join tblAssets On tblEncryptableVolume.AssetId = tblAssets.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
INNER JOIN tblDiskDrives ON tblDiskDrives.AssetID = tblAssets.AssetID
AND tblDiskDrives.Caption = tblEncryptableVolume.DriveLetter -- same drive letter
AND tblDiskDrives.DriveType = 3 -- local fixed disk
Left Join tsysIPLocations On tblAssets.LocationID = tsysIPLocations.LocationID
Order By tblAssets.AssetName