select '="'||to_char(to_date(h.period_name,'MON-YY'),'MON-YY')||'"' as period_name
,'="'||to_char(h.posted_date,'DD-MON-YYYY HH24:MI:SS')||'"' as posted_date
--,to_char(h.posted_date,v_date_format) as posted_date
-- ,to_char(h.posted_date,'DD-MON-YYYY HH:MI:SS') as posted_date
,u2.user_name as Posted_by
,replace(u2.description,',',NULL) as Posted_by_name
,replace(replace(replace(b.name,',',NULL),chr(10),NULL),chr(13),NULL) as batch_name
,h.name as journal_name
,replace(replace(replace(h.description,',',NULL),chr(10),NULL),chr(13),NULL) as description
,h.je_source
,h.je_category
--,h.date_created
,'="'||to_char(h.date_created,'DD-MON-YYYY HH24:MI:SS')||'"' as date_created
,u1.user_name as Created_by
,replace(u1.description,',',NULL) as Created_by_name
from apps.gl_je_batches b
,apps.gl_je_headers h
,apps.gl_je_categories cat
,fnd_user u1
,fnd_user u2
where b.je_batch_id = h.je_batch_id
and h.created_by = u1.user_id
and h.last_updated_by = u2.user_id
and h.je_category = cat.je_category_name
and h.set_of_books_id = 1
--and h.period_name in ('JUN-10')
and h.period_name = 'APR-12'
and h.status = 'P'
and h.posted_date >= to_date('4-MAY-2012 21:00:00','DD-MON-YYYY HH24:MI:SS')
order by h.posted_date;