COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: wwconslt on 14 Apr 2014 08:12:18 PM

Title: Converting 24 hour military time to standard time
Post by: wwconslt on 14 Apr 2014 08:12:18 PM
Hello,

I'm using Cognos 10.1.1 with relational data (Informix).  I was hoping to find a simple solution on my own but still haven't found it.  I'm trying to convert 24 hour military time values to standard time.  I have a query item called "start time" that is displaying as 1630 in my report and would like it to show as 4:30 PM.

Thank you for your help.
Title: Re: Converting 24 hour military time to standard time
Post by: Francis aka khayman on 15 Apr 2014 02:04:46 AM
try to set the format in Data Format property
Title: Re: Converting 24 hour military time to standard time
Post by: wwconslt on 15 Apr 2014 07:28:10 AM
Thanks.  I tried that that but it doesn't affect the values. 
Title: Re: Converting 24 hour military time to standard time
Post by: rih9000 on 15 Apr 2014 07:35:24 AM
I made a video showing you how to do this ...

http://youtu.be/Azs8KsAyG4w

rih9000
8)
Title: Re: Converting 24 hour military time to standard time
Post by: wwconslt on 15 Apr 2014 08:42:06 AM
Thank you for taking the time to make the video which is great! Much appreciated!
Title: Re: Converting 24 hour military time to standard time
Post by: wwconslt on 15 Apr 2014 09:51:48 AM
Hi Again rih9000,

I was able to remove the comma in the report page by changing the data format to Number, then changing the "Use Thousands Separator" to No.  However, if I try to change the data format to Time with the colon, it won't display--it reverts back to 1,200.  How would I remove the comma and insert the colon?

Thank you.
Title: Re: Converting 24 hour military time to standard time
Post by: rih9000 on 15 Apr 2014 03:21:40 PM
There's more than one way to do that. Here is a video on my way:

http://youtu.be/XP3lF_80mu0

rih9000
:)
Title: Re: Converting 24 hour military time to standard time
Post by: rih9000 on 15 Apr 2014 03:50:31 PM
... in my video a few minutes ago, I forgot to subtract 12 from the military time. Here's the fix for that ...

https://www.youtube.com/watch?v=E9oZlz_YpQk

cheers
rih9000
8)
Title: Re: Converting 24 hour military time to standard time
Post by: wwconslt on 16 Apr 2014 09:37:18 AM
Thanks so much for the clear and helpful videos.  A great solution!  It's interesting that the data format property for time doesn't work for me either.  On my desktop or laptop environments.