Mike, You can use ROUND in your Select statement and do the math there. For example, replace TotalPhysicalMemory0 as 'Total Physical Memory' with ROUND(MEM.TotalPhysicalMemory0 / 1024.00, 0) AS [Memory (MB)] Jim From: [email protected] To: [email protected] Subject: [mssms] SQL query question - convery to GB or MB Date: Fri, 3 Jan 2014 19:56:23 +0000
How can I convert the results from this query to show in MB or GB? select Netbios_Name0 as 'Server Name', Description0, InitialSize0 as ' Page File Initial Size', MaximumSize0 as 'Page File Max Size', TotalPageFileSpace0 as 'Total Page File Space', TotalPhysicalMemory0 as 'Total Physical Memory' From v_R_System VRS Join v_GS_PAGE_FILE_SETTING PFILE on PFILE.ResourceID = VRS.ResourceID JOIN v_GS_X86_PC_MEMORY MEM on MEM.ResourceID = VRS.ResourceID I saw John Nelson has a post on this, but was wondering if there was a different way: http://myitforum.com/myitforumwp/2011/11/02/sql-function-convert-bytes-to-kb-mb-gb-tb-pb-or-eb-and-format-the-output-to-human-readable-format/ Mike D-
<<inline: image001.png>>

