Page 1 of 1

Delete in TI by current year

Posted: Thu May 07, 2009 2:20 pm
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

Re: Delete in TI by current year

Posted: Thu May 07, 2009 5:08 pm
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