Here is how I do it for OS and Service Packs
select
v_GS_OPERATING_SYSTEM
Compare output to out of the box SCCM report