Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Milliseconds shown in report although format is hh:mm:ss
Max Bo
<p>Hi,</p><p> </p><p>I have a report with a table that shows this value from a postgres server:</p><p> </p><p>...</p><p>, (max(enddate) + ( intervals * '1 minute'::interval )) - now() as until_schedule</p><p>...</p><p> </p><p>When displaying this value in the table it is shown as 00:01:48.950568 for example. although I have set the date/time format for that data field to hh:mm:ss and would expect 00:01:48</p><p> </p><p>Is there a specific reason for this behaviour and how can I resolve it?</p><p>Thanks for any hint!</p><p> </p><p>Max</p>
Find more posts tagged with
Comments
micajblock
<p>What is the data type? It is probably returning a string.</p>
Max Bo
<p>Just checked it, you are right: it is a string ...
Is there a way to specify in the SQL what the data format should be?</p>
micajblock
<p>The database decides on the format. Why don't you just to a sub string and get the first 8 characters?</p>
Clement Wong
<p><span style="font-size:12px;">The SQL function in your first post returns an "interval" PostgreSQL date/time data type (<a data-ipb='nomediaparse' href='
http://www.postgresql.org/docs/8.2/static/datatype-datetime.html#AEN4903'>http://www.postgresql.org/docs/8.2/static/datatype-datetime.html#AEN4903</a>)
. For example, the result could be "-18 days -17:40:36.141333". BIRT would interpret this as a string.</span></p><p> </p><p><span style="font-size:12px;">If you know that your result doesn't have any days, months, year parts in the interval (only time parts), you could probably update your SQL and have the result returned as time, and then BIRT can format date/time with the hh:mm:ss format:</span></p><p> </p><p><span style="font-size:12px;">[color=rgb(0,0,255);]<strong> (</strong>[/color](max(enddate) + ( intervals * '1 minute'::interval )) - now()[color=rgb(0,0,255);]<strong>)::time</strong>[/color] as until_schedule</span></p><p> </p><p><span style="font-size:12px;">Otherwise, you can use three EXTRACT functions and build your own hh:mm:ss string in the SQL.</span></p>