IBM Cognos Analytics Platform > Query Studio

How to use _add_hours((current_time),-3) in detail filter?

(1/1)

lrjurgen:
Relative newbie/rookie to Cognos:
I am working in Cognos 11.1, trying to use _add_hours() comparing with a create_stamp in the data (SQL Server).

My create_stamp looks like this: 11 Apr, 22 3:30:51 PM

I am trying to pull back records where the create stamp is greater than current_time minus 3 hours.

I have tried the following and none are working:
[wms].[it_f].[create_stamp] > _add_hours ( current_date , -3)
[wms].[it_f].[create_stamp] > _add_hours ( current_time , -3)
[wms].[it_f].[create_stamp] > _add_hours ( current_timestamp , -3)

Tell me where I've gone off the rails here...

dougp:
Is create_stamp a date or string data type?

lrjurgen:
They call it a Timestamp data type in the screens I can see.
I'm assuming its a date/time data element. I don't have access to the DB directly (cloud system).

dougp:
From what you have described


--- Code: ---[wms].[it_f].[create_stamp] > _add_hours ( current_timestamp , -3)
--- End code ---

will work.  Maybe there's a detail you didn't mention.

Navigation

[0] Message Index

Go to full version