Formatting Date Objects

I read this thread about using trunc() on date objects, but I am not sure if this is just a BusinessObjects issue or something I can fix in the Designer.

I have an Oracle 9i DB, and a table with a DATE column. An object in the universe is defined as type Date and the definition is just that date column’s name. That column in the table is (unsuprisingly) filled with regular dates, like 7/8/2005. Using the object in a report shows 7/8/2005. But when I go to Data->View Data, that object shows up like 7/8/2005 12:00:00AM. This in turn causes the 3349 Numeric error when exporting to Excel.

I tried changing the definition of the object to trunc(date_column), and nothing is affected. Has anyone else noticed this? It seems BusObj is just converting the object to DateTime internally irregardless of what it actually is.


Namlemez :djibouti: (BOB member since 2005-03-14)

Namlemez,

I am wondering why you are getting error while exporting a datetime column in excel, we do it all the time with no problems.


reemagupta (BOB member since 2002-09-18)

Look for this discussion on forumtopics


reemagupta (BOB member since 2002-09-18)

The minutes and seconds are added by some of the database parameter settings:
‘dd-MM-yyyy HH:mm:ss’
DD-MM-YYYY HH24:MI:SS

This is either in the .prm file or in the .sbo file, depending on which version of Business Objects you are using.


cindihowson (BOB member since 2002-08-30)

Reema,

I am not sure why I get the error either, but it doesn’t seem totally uncommon. I’m only trying to export 3 columns and about 50 rows, so I don’t think the problem is the 65k limit. All my dates are also in 2005.

Cindi,

That is interesting, I will try that out and let everyone know how it works. Thanks!


Namlemez :djibouti: (BOB member since 2005-03-14)

I am using BusObj 6.5 full client and the Oracle DB client as my middleware. I modified the oracle.prm file at C:\Program Files\Business Objects\BusinessObjects Enterprise 6\dataAccess\RDBMS\connectionServer\oracle and changed the following lines as such:


<Parameter Name="USER_INPUT_DATE_FORMAT">'dd-MM-yyyy'</Parameter>
<Parameter Name="DATABASE_DATE_FORMAT">DD-MM-YYYY</Parameter>

The results appeared the same. I started a new report from scratch, pulled in two date objects, and ran the report. When I went to Data->View Data, the dates all have 12:00:00AM stuck on the end.


Namlemez :djibouti: (BOB member since 2005-03-14)

I wonder if that’s the PRM file your machine is using. I seem to recall finding multiple PRM files on my PC. You may want to perform a search for PRM files.

I don’t understand why the dates would be causing your problem, though. I output dates with time to Excel without any problems. It’s possible there’s some problem with Excel / Office / Windows on your PC. Have you tried this on another computer?


sunspot :us: (BOB member since 2003-03-12)

I actually managed to figure out the overflow, but it was a typo that was too low, not too high. I’m still having this goofy problem with the time being appended under all conditions, but I will try searching for more PRM files. :crazy_face:


Namlemez :djibouti: (BOB member since 2005-03-14)

Keep in mind that when you truncate a date, I believe Oracle still returns the full datetime - just truncated to midnight - if the column is a datetime column. The default is ‘DD’. You can change that - don’t know if that’ll cause the time to drop off or not. I don’t think it will, if the column is DATE. I think the PRM file will need to be changed.

See this page I found on the Internet for date TRUNC parameters:

http://www.comp.hkbu.edu.hk/docs/o/oracle10g/server.101/b10759/functions207.htm#i1002084


sunspot :us: (BOB member since 2003-03-12)

Thank you for the link, but it doesn’t seem to be true! :confused:

One of things I tried as a sanity check was running the query both in SQL*Plus (standard Oracle DB client) as well as TOAD (popular GUI tool).

When using trunc on the date column, both give me:

15-NOV-03

Namlemez :djibouti: (BOB member since 2005-03-14)

Are you sure the applications aren’t formatting the date as they display it, though? The same way BO does when you display a date in a report. They might be automatically hiding the time portion of the date if the time value is zero, even though the database itself could still be returning the time.

I know I’ve been through all this once before, but it was awhile back and of course I’ve forgotten exactly how Oracle handles all of the datetime options. Like I said though, the time values shouldn’t make any difference if they’re all zero.


sunspot :us: (BOB member since 2003-03-12)

FWIW, I just did a select in TOAD against a column where some of the dates are stored truncated and some aren’t. The truncated dates are showing without any timestamp in the data grid in TOAD. The dates with a timestamp other than exactly midnight are showing with the timestamp. I suspect this is an application thing. In BO, they all have timestamps if you look at the data in the cube.


sunspot :us: (BOB member since 2003-03-12)