COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: lifzgud on 19 May 2010 07:12:49 AM

Title: How to get Timestamp in specific format
Post by: lifzgud on 19 May 2010 07:12:49 AM
Hi,
I want a particular timestamp in my report filter.
For eg if the current date returns 18th May 2010
I want it like 2010-05-18 18:30:00.000
Please note that  18:30:00.000 is supposed to be constant.
Only the date would change.
Title: Re: How to get Timestamp in specific format
Post by: tupac_rd on 19 May 2010 01:32:20 PM
can you please elaborte how you are planning to use it..
Title: Re: How to get Timestamp in specific format
Post by: lifzgud on 20 May 2010 03:52:03 AM
I want to use it in a filter.
the reference column in the table is a date time field.
I want to pick up data only till Saturday 6:30 om for each week.
That is previous Saturday after 6:30 to latest Saturday till 6:30
Title: Re: How to get Timestamp in specific format
Post by: Gopinath on 20 May 2010 05:14:54 AM
If the timestamp is constant why can't you just filter based on the date

If the source column is a datetime field try CASTing it to date
Title: Re: How to get Timestamp in specific format
Post by: mvjcognos on 14 Jul 2010 03:57:55 AM
Try with to_char it will show the required format
to_char(sysdate,'YYYY-MM-DD HH:MM:SS) it will show the time also respective to the system

or

if u want time should be constant u can concanate the time with the data item like this...inside a data item
to_char(sysdate,'YYYY-MM-DD')||' '||18:30:00.000