I use this to convert a date filed to year_week, year_month, year_quarter and year.
But when I use it in views I got problem with queries, they take long time...
Is this the best way to do this?
Select to_char(rec_date, 'yyyy') || to_char(rec_date, 'IW') As year_week,
to_char(rec_date, 'yyyy') || to_char(rec_date, 'mm') As year_month,
to_char(rec_date, 'yyyy') || '0' || to_char(rec_date, 'q') As year_quarter,
to_char(rec_date, 'yyyy') As year
FROM tbltest