Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #31203

    Hi there,

    I’ve succeeded in grouping rows of a report by year & month using the column definition:

    SELECT SUBSTRING ( CAST (inv.datetime AS CHAR(10) DATE FORMAT ‘yyyy-mm-dd’), 1 FOR 7 ) AS _inv_year_month

    This seems rather inelegant. Is there a simple way of doing this?



    >> This seems rather inelegant
    No – that’s a perfectly reasonable method of getting the year and month from the date. You could also look at the EXTRACT function which allows you to extract the YEAR and the MONTH and then concatenate them, but your solution is good too.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.