Thanks again for your reply! I am not sure why this isnt working for me.
When I try:
Convert(Date,Left(SubQuery2.Value, 8)) As [Deploy Date 2],
I get the error: The specified data type is not valid. [ Data type (if known) = Date ]
When I try:
Convert(DateTime,Left(SubQuery2.Value, 8)) As [Deploy Date 2],
I get the error: There was an error parsing the query. [ Token line number = 1,Token line offset = 833,Token in error = Left ]
This is the full report code:
Select Top 1000000 tblAssets.AssetName As Computer,
tblAssets.Username,
tblOperatingsystem.Caption As OS,
tblAssets.OScode As [OS Build],
tblAssets.Version As [OS Version],
tblAssetCustom.Manufacturer As Make,
tblAssetCustom.Model As Model,
tblAssetCustom.Serialnumber As SN,
tblWinSAT.WinSPRLevel As WinSAT,
Cast(tblAssets.Memory / 1024 As numeric) As [RAM GB],
tblAssets.Processor As CPU,
Cast(Cast(tblFloppy.Size As bigint) / Power(10, 9) As numeric) As [Drive GB],
Case
When tblEncryptableVolume.ProtectionStatus = 0 Then ''
When tblEncryptableVolume.ProtectionStatus = 1 Then 'ON'
Else 'UNKNOWN'
End As BitLocker,
tblFloppy.Model As [Drive Model],
tblFloppy.FirmwareRevision As [Drive FW],
tblFloppy.SerialNumber As [Drive SN],
SubQuery2.Value As [Deploy Date],
Convert(Date,Left(SubQuery2.Value, 8)) As [Deploy Date 2],
tblOperatingsystem.InstallDate As Install,
tblAssetCustom.PurchaseDate As Purchase,
tblAssetCustom.Warrantydate As Warranty,
tblAssets.LastActiveScan As Active,
tblAssets.Lastseen As Last,
tblAssets.Lasttried As Tried,
tblAssets.Firstseen As Initial,
SubQuery1.Value As [Deploy Name]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblFloppy On tblAssets.AssetID = tblFloppy.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Left Join (Select tblRegistry.AssetID,
tblRegistry.Value
From tblRegistry
Where tblRegistry.Valuename = 'Task Sequence Name') SubQuery1 On
SubQuery1.AssetID = tblAssets.AssetID
Left Join (Select tblRegistry.AssetID,
tblRegistry.Value
From tblRegistry
Where tblRegistry.Valuename = 'Deployment Timestamp') SubQuery2 On
SubQuery2.AssetID = tblAssets.AssetID
Inner Join tblEncryptableVolume On
tblAssets.AssetID = tblEncryptableVolume.AssetId
Inner Join tblWinSAT On tblAssets.AssetID = tblWinSAT.AssetId
Where tblOperatingsystem.Caption Not Like '%Windows Server%' And
tblAssetCustom.Model <> 'Virtual Machine' And
tblFloppy.Name Like '%PHYSICALDRIVE0' And tblDiskdrives.Caption = 'C:' And
tblAssetCustom.State = 1 And tblEncryptableVolume.DriveLetter = 'C:'