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


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

Started by lrjurgen, 11 Apr 2022 04:08:58 PM

Previous topic - Next topic


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...



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).


From what you have described

[wms].[it_f].[create_stamp] > _add_hours ( current_timestamp , -3)

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