COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: gosoccer on 20 Jun 2017 10:24:41 AM

Title: Filtering In a Subject Query, Date/Time in FM Model (Relational)
Post by: gosoccer on 20 Jun 2017 10:24:41 AM
Hi everyone, if you could help with this issue, I greatly appreciate it.  :) :)

In Framework Manager (Relational) I'm trying to run a filter on a specific date. The date is in Date and Time, not just Date.

The following is failing and I'm not sure how to handle it when the DB is DB2. It's in the Subject Query as a Filter.

[SOLD_DATE]   >= '2016-12-01 00:00:00' and [SOLD_DATE]  <= '2016-12-31 00:00:00'

This query contains an error and can not be executed.

It is recommended that you view the query feedback on the "Query Information" tab.

RQP-DEF-0177 An error occurred while performing operation 'sqlPrepareWithOptions' status='-126'.
UDA-SQL-0460 A general exception has occurred during local processing.
UDA-EE-0094 The operation "greater_equal" is invalid for the following combination of data types: "date2" and "character"

--------------------------------------------------------------------------------
I think I need to do some sort of CAST perhaps but even using CAST is not helping.

Thanks for your time.
Title: Re: Filtering In a Subject Query, Date/Time in FM Model (Relational)
Post by: the6campbells on 20 Jun 2017 06:28:42 PM
timestamp literal is written as 2017-06-20 19:26:00.000 (note not a quoted string literal) it will be expressed in the appropriate literal notation for whatever database it is sent to (if the vendor supports time stamps)


for more examples, look at the constants section of the expression editor in Report Studio or Framework Manager