/*  Date Created:	October 7, 2004
	Created by:		Loren Cook
	Description:	Return Child Values with Reporting Attributes from Budget Purpose Value Set*/

SELECT DISTINCT
	value.FLEX_VALUE as "Budget Purpose",
	descript.DESCRIPTION as "Budget Purpose Title",
	value.ENABLED_FLAG as "Enabled Y/N",
	SUBSTR(value.CREATION_DATE,1,10) AS "Creation Date",
	SUBSTR(value.END_DATE_ACTIVE,1,10) AS "End Date",
	SUBSTR(value.LAST_UPDATE_DATE,1,10) AS "Last Update",
	value.attribute4 as "Fiscal Officer",
	value.attribute5 as "Unit Cost",
	value.attribute6 as "LCME",
	value.attribute7 as "RAMP",
	value.attribute8 as "A-21 Function",
	value.attribute9 as "A-21 Crosswalk",
	value.attribute10 as "NSF Code",
	value.attribute11 as "CIPS Code",
	value.attribute12 as "Decision Center",
	value.attribute13 as "Unit Link",
	value.attribute14 as "Interest Budget Purpose"

FROM APPLSYS.FND_FLEX_VALUE_SETS sets, APPLSYS.FND_FLEX_VALUES value, APPLSYS.FND_FLEX_VALUES_TL Descript

where sets.flex_value_set_id = value.flex_value_set_id
    and value.flex_value_id = descript.flex_value_id
	and sets.flex_value_set_id = '1002351'
	and value.enabled_flag = 'Y'
	and value.summary_flag = 'N'
	and not value.flex_value = '000000'
	--and not value.END_DATE_ACTIVE is Null
	--and value.LAST_UPDATE_DATE between '05/15/2002 00:00:00' and '06/30/2002 23:59:59'





