Delete in TI by current year

Post Reply
andersknudsen
Posts: 8
Joined: Thu May 07, 2009 2:10 pm
Version: 8.4
Excel Version: 2007

Delete in TI by current year

Post by andersknudsen »

Hi

I would like to delete from a cube but only data from current year. I can't find a function returning current year (v8.4).

I have tried something like this:
-----------------------------------------------
ODBCOpen('STAMDB', '', '');
SubsetCreate('YEAR', 'NU');
a=ODBCOutput('STAMDB', 'select year(getdate())');
SubsetElementInsert('YEAR', 'NOW',a,1);
ODBCClose('STAMDB');
-----------------------------------------------

but I can't get it working.

Please help me :-) Thanks in advance.

/Anders
TomBr
Posts: 32
Joined: Tue Jun 03, 2008 6:56 pm

Re: Delete in TI by current year

Post by TomBr »

Hi,

If you simply want to generate the current calendar year in TI, the following code will work in 8.4.

CurrYear = TIMST( Now(), ' \Y');

Tom
Post Reply