BusinessObjects Board

Current Date

Hi,

I am trying to create Current date object in designer(E Fashion Universe) for practice on BO.i do not have any database install on my system.it is giving me date() function to use it but i don’t know how to use it.Plz help


bob2210 (BOB member since 2010-09-23)

[Moderator Note: Moved from WebIntelligence XI to Semantic Layer / Universe Designer]


Marek Chladny :slovakia: (BOB member since 2003-11-27)

If you don’t have a database installed, you won’t know the syntax.

Designer needs a connection to validate objects against.

I’d recommend getting SQL Express installed - SQL Server 2019 | Microsoft

Relative dates are discussed in this topic:

Hi Mark,

Ms Access Database is present and The error i am getting while using date() function is related to MS access database.


bob2210 (BOB member since 2010-09-23)

Please post the exact text of the error message that you are getting.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

The current date functions do not parse in Designer - they need to be included with table-based data at the report level to work.

Hi Mark,

i am getting following error: " Parse failed: Exception: DBD, [Microsoft][ODBC Microsoft Access Driver] Syntax Error in From Clause.State:4200 ".

The reason i am creating Current date object is bcoz i want to create previous week,previous month,last month …etc objects which based on current date.


bob2210 (BOB member since 2010-09-23)

Is that in the query?

They don’t parse in Designer. Designer validates objects based on looking for the table name.

Table1.ColumnA will parse because it’s found Table1
Date() will NOT parse because it cannot find a table to associate.

It tries to do “SELECT ColumnA from Table1”
"SELECT Date() from " won’t parse.

You’d write SELECT Date() in a query, no need for the from statement.
The same applies to SYSDATE in Oracle and GETDATE() in SQL Server.

Include it in a query with objects that are from a table and you will be fine.

I’m using SQL Server and have a Today object using getdate(). It doesn’t parse at the designer level, but it works fine in reports because I can use a predefined condition or a report query filter:

Sales_Calendar.Sale_Date = <Today> 

(where is the object)

Hope that clears it up for you.

Regards,
Mark

Hi Mark,

Let me summarise my problem:

I want to create a condition object(Current Date) in designer (EFashion universe) . I have only BO XIR3 on my machine.

I understood what your mean.Could you tell me the exact code or steps which i should implement


bob2210 (BOB member since 2010-09-23)

I’m not familiar with MS Access syntax any more.

I assume the following:
You have a part-developed universe based on the MS Access database.
You have Desktop Intelligence access and the privileges to create reports with it.
You know what object you want to compare to current date (e.g. call date).

In Designer, create an object for Today (defined as Date() I think)
In the bottom left corner of the Designer window, you will see the two radio buttons for objects and filters. Click the filter one.
Choose the folder you want to put the pre-defined condition in, right-click on it and choose Condition from the context menu.

In the Where section, click on the double right arrow to open the edit dialog box. Choose the date column that you want to compare and double click on it. It will appear in the edit space at the top. Then press the “=” key on your keyboard. Now navigate through the classes and objects to find your Today object. Double click on it. Your condition will then look something like:

D_INVOICEDATE.calendar_date=@Select(Calendar Dates\Today)

Save your universe and build a report in Desktop Intelligence to test the condition.

Drag a few objects in as well as the condition and give it a run.

Hi Mark,

Thanks for the help
When you said
[In Designer, create an object for Today (defined as Date() I think)
]

Could you tell me what should i put in select section. or how should i defined it.[/code]


bob2210 (BOB member since 2010-09-23)

Create an Object in the universe with select as Date() now this will return you the current system date and you can use this object in the select or where clause of your report query.

However you need to use it in combination of other objects which are refrencing tables in the universe, you can not use this object alone in your query.


saurabhg :india: (BOB member since 2007-04-02)

Hi Saurabh,

when i am creating object with only date() in select.it is giving me error which i posted earlier.


bob2210 (BOB member since 2010-09-23)

Hi Mark,

As you said earlier
"
I’m using SQL Server and have a Today object using getdate(). It doesn’t parse at the designer level, but it works fine in reports because I can use a predefined condition or a report query filter:"

how can it be possible if object is not parsed.


bob2210 (BOB member since 2010-09-23)

What other objects you are trying to bring in the query apart of this date objects?

Because if i am trying on my system with this date() object and sales, week, month in my query i am able to generate the report.


saurabhg :india: (BOB member since 2007-04-02)

This is covered in the Designer FAQ. In short, objects that do not reference a table will not parse because functions like “date” are valid syntax, but Designer is expecting a table. So the parse logic tries to run this:

select date from

It’s incomplete. But in a query with other objects, you get this:

select table.col1, date from table

Now it works, because date doesn’t have to come from a table.


Dave Rathbun :us: (BOB member since 2002-06-06)

It does not parse at the Designer level and never will because it is a system function that doesn’t use a table. Designer expects a table to be included in the query. Trust me, I’ve created the odd object or two that work like this. :wink:

Hi Guys,

I did it. I choose tabe tab at bottom and select any table from the list and my object is parsing fine. i only use date() inside the Select section.


bob2210 (BOB member since 2010-09-23)

Well done. Now you’ve tied that table in with the object. :roll_eyes:

We don’t give advice to mislead you. :hb:

Hi Mark,

I appeciate your help and rest all.

Thanks guys. :slight_smile:


bob2210 (BOB member since 2010-09-23)