If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

getdate() minus 1

Started by Bourbz, 13 Nov 2007 04:30:53 PM

Previous topic - Next topic

Bourbz

Hi I am new to COGNOiSe and am seeking some help....

I have conditional formatting on a date field and an wanting to display different coloured text for data that is older than today.

In short, I need to know the coding for TODAY MINUS 1 or 2......

I know this is probably really easy, but I'm stumped.


Eromac

Hi, if you're using SQL as DB you can try this
DateAdd(dd, DateDiff(dd,0,GetDate()-1), 0)

Bourbz

That doesn't help as I need to do within a boolean.

Is there something I can do around Today() minus 2?

rockytopmark

Boolean Expression:

[YourQuery].[yourDateItem] < Today()

If your date item is in the past, then the condition is met, TRUE.

Bourbz

Thanks Rocky.

Being that I am in Australia and our warehouse is update with data from US this means I would need today's date minus 2 days, because of the data dely.

lastsummer

if using oracle, add a filter [time]<trunc(add_days({sysdate},-2),'dd'),
maybe work

rockytopmark

Solution for the Variable Expression we started earlier, you can change date using this getup:

_add_days(date2timestamp(Today()), -1)

... Today is Nov 14, 2007 and it is returning Nov 13, 2007

So now the Variable Expression would be:

[YourQuery].[yourDateItem] < _add_days(date2timestamp(Today()), -1)

Bourbz

Thanks Rocky.

Now just have to wait for next data load to check if it's functional.