Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Extracting a MONTH and YEAR from a date

edited January 2005 in General
Hi,

I have extracted a month froma date using the expression

EXTRACT(MONTH FROM PERF_DATE)

However, for a cross tab I need a field that doesnt just display 1 or 2
(for Jan or Feb), but a field that dsiplays Jan-05 or Feb-05

How do I extract the month AND year, so that I can group by just that?

(I tried just changing the PERF_DATE display format too mmm-yy, but the
inherent data in the field causes the data to be grouped by exact date [dd-
mm-yy] on my crosstab.)

Thanks
Red

Comments

  • edited January 2005
    Hi Red,

    Try creating two aggregate fields, one extracting the year and one
    extracting the month. Then order your dataset based on year, then month.
    This will get your dataset in a logical order to group on the month field.
    Then you can use the crosstab formatting events to edit the output of the
    original DateTime field. See the CrossTab demos for examples of this.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.