COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: kaevne on 26 Feb 2009 03:56:25 PM

Title: Removing Time from a Date/Time query item
Post by: kaevne on 26 Feb 2009 03:56:25 PM
I know this question has been asked, but none of the proposed solutions seem to be working for me.

I have a Date/Time data item query that runs across the top row of my crosstab.

It lists all of the Data in that column across the row.  However, it shows the Date and the Time.  And I only want the Date to be listed.

Unfortunately, selecting the query *on the crosstab* and editing the data format has no effect.  I don't understand why the side references would have a data format property when it has no effect!  I tried changing it to "Date" or to Date/Time and hiding the time, changing the display style, etc.  None of which do anything. 

However, the data format does actually work when it's applied to the actually crosstab cells (aka the "real" data).

Anyone have any ideas?
Title: Re: Removing Time from a Date/Time query item
Post by: blom0344 on 27 Feb 2009 06:38:04 AM
Any chance you can create a second dataitem where you convert the date/time to a string (holding only the date part) and then use the first date/time dataitem for the sort?
Title: Re: Removing Time from a Date/Time query item
Post by: Nuffsaid on 27 Feb 2009 11:06:23 AM
When you initially drop a date or date time data item into the "Columns" section of a crosstab, the "Source Type" property is set to Member Caption. You need to change this property to "Data Item Value" in order to do any date formatting. This is also true when using dates in charts.
Title: Re: Removing Time from a Date/Time query item
Post by: kaevne on 27 Feb 2009 01:14:06 PM
Thank you for both of you.  Both solutions worked. 

The first one I just used a sqlserver function cast_char then substringed it.  It came out as substring(cast_char([Endtimes].[R_EndTime]),1,11) which cut the date into what I needed.

I also changed the format to Dota Item Value and the formatting worked!  Thanks guys!  Karma to both of you!
Title: Re: Removing Time from a Date/Time query item
Post by: KANUL on 04 Mar 2009 04:19:21 AM
u can also use data format and then select date from that and then select which all things you want to display