‎03-01-2011 03:37 PM
Select Top 100 Percent dbo.tblComputers.Computername As Computer, tblComputersystem.Model As [Computer Model], dbo.tblDiskdrives.Caption As Drive, Cast(Cast(dbo.tblDiskdrives.Size As BigInt) / 1024 / 1024 / 1024 As Numeric) As [Total size (GB)], Cast(Cast(dbo.tblDiskdrives.Freespace As BigInt) / 1024 / 1024 / 1024 As Numeric) As [Free in GB], Cast((Cast(dbo.tblDiskdrives.Size As BigInt) - Cast(dbo.tblDiskdrives.Freespace As BigInt)) / 1024 / 1024 / 1024 As Numeric) As [Used Space (GB)], tblFloppy.Model As [HDD Model], dbo.tblDiskdrives.Lastchanged As [Last changed] From dbo.tblComputers Inner Join dbo.tblDiskdrives On dbo.tblComputers.Computername = dbo.tblDiskdrives.Computername Inner Join dbo.tblOperatingsystem On dbo.tblComputers.Computername = dbo.tblOperatingsystem.Computername Inner Join tblComputersystem On dbo.tblComputers.Computername = tblComputersystem.Computername Inner Join tblFloppy On dbo.tblComputers.Computername = tblFloppy.Computername Where dbo.tblDiskdrives.DriveType = '3' Order By dbo.tblComputers.Computername, dbo.tblDiskdrives.Caption, tblFloppy.Model
Solved! Go to Solution.
‎03-01-2011 10:41 PM
Select Top 100 Percent dbo.tblComputers.Computername As Computer,
tblComputersystem.Model As [Computer Model], dbo.tblDiskdrives.Caption As
Drive, Cast(Cast(dbo.tblDiskdrives.Size As BigInt) / 1024 / 1024 /
1024 As Numeric) As [Total size (GB)], Cast(Cast(dbo.tblDiskdrives.Freespace
As BigInt) / 1024 / 1024 / 1024 As Numeric) As [Free in GB],
Cast((Cast(dbo.tblDiskdrives.Size As BigInt) -
Cast(dbo.tblDiskdrives.Freespace As BigInt)) / 1024 / 1024 / 1024 As
Numeric) As [Used Space (GB)], tblFloppy.Model As [HDD Model],
dbo.tblDiskdrives.Lastchanged As [Last changed],
Cast(Cast(Cast(dbo.tblDiskdrives.Freespace As BigInt) As Numeric) /
Cast(Cast(dbo.tblDiskdrives.Size As BigInt) As Numeric) * 100 As BigInt) As
[Used PCT]
From dbo.tblComputers Inner Join
dbo.tblDiskdrives On dbo.tblComputers.Computername =
dbo.tblDiskdrives.Computername Inner Join
dbo.tblOperatingsystem On dbo.tblComputers.Computername =
dbo.tblOperatingsystem.Computername Inner Join
tblComputersystem On dbo.tblComputers.Computername =
tblComputersystem.Computername Inner Join
tblFloppy On dbo.tblComputers.Computername = tblFloppy.Computername
Where dbo.tblComputers.Computername Not Like 'COMPUTER' And
dbo.tblDiskdrives.DriveType = '3'
Order By dbo.tblComputers.Computername, dbo.tblDiskdrives.Caption,
tblFloppy.Model
‎03-01-2011 10:41 PM
Select Top 100 Percent dbo.tblComputers.Computername As Computer,
tblComputersystem.Model As [Computer Model], dbo.tblDiskdrives.Caption As
Drive, Cast(Cast(dbo.tblDiskdrives.Size As BigInt) / 1024 / 1024 /
1024 As Numeric) As [Total size (GB)], Cast(Cast(dbo.tblDiskdrives.Freespace
As BigInt) / 1024 / 1024 / 1024 As Numeric) As [Free in GB],
Cast((Cast(dbo.tblDiskdrives.Size As BigInt) -
Cast(dbo.tblDiskdrives.Freespace As BigInt)) / 1024 / 1024 / 1024 As
Numeric) As [Used Space (GB)], tblFloppy.Model As [HDD Model],
dbo.tblDiskdrives.Lastchanged As [Last changed],
Cast(Cast(Cast(dbo.tblDiskdrives.Freespace As BigInt) As Numeric) /
Cast(Cast(dbo.tblDiskdrives.Size As BigInt) As Numeric) * 100 As BigInt) As
[Used PCT]
From dbo.tblComputers Inner Join
dbo.tblDiskdrives On dbo.tblComputers.Computername =
dbo.tblDiskdrives.Computername Inner Join
dbo.tblOperatingsystem On dbo.tblComputers.Computername =
dbo.tblOperatingsystem.Computername Inner Join
tblComputersystem On dbo.tblComputers.Computername =
tblComputersystem.Computername Inner Join
tblFloppy On dbo.tblComputers.Computername = tblFloppy.Computername
Where dbo.tblComputers.Computername Not Like 'COMPUTER' And
dbo.tblDiskdrives.DriveType = '3'
Order By dbo.tblComputers.Computername, dbo.tblDiskdrives.Caption,
tblFloppy.Model
‎03-01-2011 06:47 PM
‎03-01-2011 06:31 PM
‎03-01-2011 06:34 PM
pentel wrote:
Nope doesn't work 😞 gives back 0 results
I think this might have something to do with null values, would that make sense?
Thanks by the way for the quick reply!
‎03-01-2011 04:57 PM
Select Top 100 Percent dbo.tblComputers.Computername As Computer,
tblComputersystem.Model As [Computer Model], dbo.tblDiskdrives.Caption As
Drive, Cast(Cast(dbo.tblDiskdrives.Size As BigInt) / 1024 / 1024 /
1024 As Numeric) As [Total size (GB)], Cast(Cast(dbo.tblDiskdrives.Freespace
As BigInt) / 1024 / 1024 / 1024 As Numeric) As [Free in GB],
Cast((Cast(dbo.tblDiskdrives.Size As BigInt) -
Cast(dbo.tblDiskdrives.Freespace As BigInt)) / 1024 / 1024 / 1024 As
Numeric) As [Used Space (GB)], tblFloppy.Model As [HDD Model],
dbo.tblDiskdrives.Lastchanged As [Last changed],
Cast(Cast(Cast(dbo.tblDiskdrives.Freespace As BigInt) / 1024 / 1024 /
1024 As Numeric) / Cast(Cast(dbo.tblDiskdrives.Size As BigInt) / 1024 / 1024 /
1024 As Numeric) * 100 As bigint) As [Used PCT]
From dbo.tblComputers Inner Join
dbo.tblDiskdrives On dbo.tblComputers.Computername =
dbo.tblDiskdrives.Computername Inner Join
dbo.tblOperatingsystem On dbo.tblComputers.Computername =
dbo.tblOperatingsystem.Computername Inner Join
tblComputersystem On dbo.tblComputers.Computername =
tblComputersystem.Computername Inner Join
tblFloppy On dbo.tblComputers.Computername = tblFloppy.Computername
Where dbo.tblDiskdrives.DriveType = '3'
Order By dbo.tblComputers.Computername, dbo.tblDiskdrives.Caption,
tblFloppy.Model
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now