Skip to Content
0
Former Member
Jul 30, 2009 at 11:51 AM

Using Variable tab name for a select

22 Views

Hi,

I need to do a select from a two different tables controled by system date.

I try to do the following for example:

Data: tabela type tabname.

if l_data ge '01012009'

tabela = 'zxx_new'

else.

tabela = 'zxx_old'

endif.

Select * from tabela

where ...

It's possible using Select statement this way ? or i need to do...

if l_data ge '01012009'

select * from zxx_new ...

else.

select * from zxx_old ...

endif.

Thanks,