If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Grouping by datetime column components

Started by nbora, 01 Feb 2024 08:58:47 AM

Previous topic - Next topic

nbora

Hi,

here is a newbie to Cognos and to the community here.

I'm trying to run a fairly simple SQL Query in Cognos but it fails.

SELECT COUNT(*) AS n_rows, LAST_DAY(DATETIME_COLUMN), MONTH(DATETIME_COLUMN), YEAR(DATETIME_COLUMN) FROM MY_TABLE GROUP BY LAST_DAY(DATETIME_COLUMN), MONTH(DATETIME_COLUMN), YEAR(DATETIME_COLUMN)

Any tip/help is greatly appreciated.

Cheers,
Bora

cognostechie

What's the error you get?

Is the SQL used as a 'Native' SQL or 'Cognos' or 'pass-through' SQL?

If it is used as a Native SQL what's the database? SQL Server does not have any LAST_DAY function but MySQL and Oracle have. The more information you provide in your 1st question, the faster you will get the answer.