Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Trying to Run a Report...What am I doing wrong?

I am trying to run a report to list computers operating system, service pack, memory and also things like diskdrive space. I try to run an sql report and select DiskDrive.Size then try to run it I get an error No Such Column: DiskDrives.Size I get this for anything other than what is under computers. Please advise what I am doing wrong. Thanks!

0

Comments

8 comments
Date Votes
  • It sounds like you may be missing the DiskDrives table in the from clause of the SQL.  You can add it like this:

    from Computers join DiskDrives using (ComputerId)
    0
  • I attached a file of what I am doing. I added the line but I am getting a syntax error when trying to run it.

    0
  • I was able to get it to work, however, when it displays it does not display in GB.

    0
  • The size column is in bytes, so you need to divide it to make it GB:

    select
    Computers.Name as "Computer Name",
    Computers.Description,
    DiskDrives.Size / 1024 / 1024 / 1024
    from Computers join DiskDrives using (ComputerId)
    where <ComputerFilter>
    0
  • Thank you very much for the quick response! One last question. If I also wanted to get a list of applications how would i create the column for applications?

    0
  • You would use the Applications table like the DiskDrives table.  

    select
    Computers.Name as "Computer Name",
    Computers.Description,
    Applications.Name
    from Computers join Applications using (ComputerId)
    where <ComputerFilter>
    0
  • I figured out how to do it for applications! Thanks for all your help!

    0
  • No worries.

    0