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()
order by purchasingMonthRaw desc
for json auto