Creating Date Object

How do I create an object in the universe which always gives the current date?

Thanks


tendulkar :india: (BOB member since 2004-03-15)

Depening on your database you can use “SYSDATE” for Oracle, etc.

Please, try a search on BOB before posting questions.

I found this thread


Andreas :de: (BOB member since 2002-06-20)

I tried…but its not working. I’m using Oracle.


tendulkar :india: (BOB member since 2004-03-15)

Please, you have to be more specific then “It is not working”.
What exactly is not working?
Any error message?
Did you do a search on BOB?


Andreas :de: (BOB member since 2002-06-20)

I used to_char(sysdate,‘mm/dd/yy’) and trucn(sysdate) and to_date function. Its not giving me the current date.

CurrDate

select: tablename

where:tablename.date=trunc(sysdate);

this is what i used


tendulkar :india: (BOB member since 2004-03-15)

In Designer create an object in the universe defined in the SELECT box as:

TRUNC (sysdate)

Data Type is Date. The WHERE box stays empty. This object will not parse by itself , because it does not reference any table (which is OK).
In Business Objects Reporter use this object to build your condtion(s).

Or you can try creating a predefined condition in the universe via Designer along the lines of:

TRUNC (TableName.TransActionDt) = TRUNC (sysdate)

Again, did you try a search on BOB?


Andreas :de: (BOB member since 2002-06-20)

The query does not reference a table (QP0007) - Getting this error if I do that. :frowning: I did search in BOB. But for some reason I’m not able to get it straight.


tendulkar :india: (BOB member since 2004-03-15)

It does not matter that this object does not parse in Designer.

Try a search on BOB, keyword: QP0007


Andreas :de: (BOB member since 2002-06-20)

This will occur if you are just returning the SYSDATE object in the query - you need to build at least one object into your query that references a table for it to run.

which database are you using?

If you are using SQL server then sysdate will not work. Use GETDATE() instead.


PBS_rocks (BOB member since 2004-03-17)

What about if I am using DB2? what syntax do I use to get the current date?

thanks


khansen97 (BOB member since 2003-12-05)

Please, take time and look at the link I provided previously: todays date as a dimension object to use as a 'condition'


Andreas :de: (BOB member since 2002-06-20)

khansen

CURDATE or CURRENT DATE should work for DB2.


jobjoris :netherlands: (BOB member since 2004-06-30)