Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- sum(Property.user_assignable) AS total_NASF,
- sum(Property.user_gross) AS total_GSF,
- Region.description As Region,
- (CASE
- WHEN UDF.Custom005 = 'Educational'
- Then SUM(Property.user_assignable)
- End) As Educational_NASF,
- (CASE
- WHEN UDF.Custom005 = 'Educational'
- Then sum(Property.user_gross)
- End) As Educational_GSF,
- (CASE
- WHEN UDF.Custom005 = 'Residence Hall'
- Then sum(Property.user_assignable)
- End) As Residential_NASF,
- (CASE
- WHEN UDF.Custom005 = 'Residence Hall'
- Then sum(Property.user_gross)
- End) As Residential_GSF,
- (CASE
- WHEN UDF.Custom005 = 'Hospital'
- Then sum(Property.user_assignable)
- End) As Hospital_NASF,
- (CASE
- WHEN UDF.Custom005 = 'Hospital'
- Then sum(Property.user_gross)
- End) As Hospital_GSF
- FROM
- ae_s_bld_c Property
- Inner JOIN dbo.ae_s_bld_c_udf UDF ON (Property.multitenant_id =
- UDF.multitenant_id)
- AND (Property.bldg = UDF.bldg)
- AND (Property.fac_id = UDF.fac_id)
- AND (Property.region_code = UDF.region_code)
- Inner Join ae_b_reg_e Region ON Property.multitenant_id =
- region.multitenant_id
- AND Property.region_code = Region.region_code
- WHERE
- (Property.bldg_status = 'ACTIVE' OR
- Property.bldg_status = 'VACANT' OR
- Property.bldg_status = 'CONSTRUCTION') AND
- Property.owned_leased = 'Y' AND
- Property.prop_type = 'BUILDING' AND
- Property.bldg_class <> 'Parking Struct' AND
- Property.region_code LIKE '28%'
- Group By
- Region.description,
- UDF.Custom005
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement