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

Struggling to get data using timestamp in Cognos

Started by dud987, 06 Apr 2017 11:13:03 AM

Previous topic - Next topic

dud987

To friends...

I have two questions

1. I have a field that contains date and time. I am trying to get data for the past 12 hours and I used this function but still struggling to get data for the past 20 hours

cast([Date/Time],hours) between _add_hours( current_timestamp,-20) and (current_timestamp)


2. If at all I have to get data from say 10.30 am yesteday to current time(say 12:00 pm, today) what function should i use ...

Please let me know, if further information is required

Thanks in advance..

New_Guy

Hi,
Try this   _add_hours ([Date/Time], 20) and let us know if it works or not.
Good luck
New guy

dud987

Thanks, New Guy for the response but didn't work out...

I found a way though

[Date/Time] between (_add_days(current_date,-1) || '11:30:00 AM') and (current_date || '12:00:00 PM')

Thanks..