How to get current date

Hi Experts,

I want to fetch current date of system.

I have used below function to get current date.

getdate()

While I am parsing this object, I am getting below error.


Parse failed: Exception: DBD , [Microsoft][ODBC SQL Driver][SQL Server] statement(s) could not be prepared. State: 42000

I have Businss Object Enterprise XI 3.1 with SP1 and Microsoft SQL server 2005.

Can anyone have idea why I am getting this error?

I really appreciate your input on this.

Regards,
Rishit
CurrentDate_Error.jpg


rishit.kamdar (BOB member since 2010-09-03)

Hi!

I think that will really give you an error if you click parse, because you are not selecting any column or object. But if you use that object let’s say in webi, you will get the result that command. Just don’t mind the error.


R.A. :philippines: (BOB member since 2008-10-28)

If you rather not have an error then if you associate a table with the object then it will parse ok. Click the tables button and choose a table.

Without a table associated then your SQL statement is literally,

SELECT getdate()

which obviously is incomplete. If you associate a table, say DIM_CALENDAR then you get,

SELECT getdate() FROM DIM_CALENDAR

which will parse fine. However this statement will return multiple rows so you’ll need to consider how this object will be used by users and then decide which table is best associated with this object if any. For a discussion of pros and cons of using system dates see this article. And also see this article.

rgds

AL


agulland :uk: (BOB member since 2004-03-17)