with data as ( select format( purchasingMonth, 'MM/dd/yyyy' ) purchasingMonth, format( purchasingMonth, 'MMMM yyyy' ) as purchasingMonthDisplay, purchasingMonth as purchasingMonthRaw from tbl_DW_PurchasingMonths#_tableSuffix# with (nolock) where ownerId = and ownerType = and purchasingMonth <= getDate() ) #forJSON( 'data', attributes.datastore, 'purchasingMonthRaw' )#