Hello everyone,
In the code below I`m targeting a database called t_lg202001 which refers to a log table of a specific year and month. In this case January 2020. See code below:
SELECT a.EVTLGUID, a.DEVDT, a.USRID, c.NM, b.NM FROM t_lg202001 a JOIN t_evttyp b ON a.EVT = b.EVT JOIN t_usr c ON a.USRID = c.USRID WHERE a.USRID IS NOT NULL ORDER BY a.EVTLGUID DESC LIMIT 1;
As my target table is going to be update every month as the years goes by I need to change this line of code for every single month and afterwards years. i.e:
t_lg202001 = January 2020.
t_lg202002 = February 2020.
...
...
...
t_lg202012 = December 2020
t_lg202101 = January 2021
...
..
t_lg202112 = December 2021.
I really would like to manipulate that line of the code through a variable where I can automate as required.
Does anyone has any idea or how this can be done?
If there isn`t any way at the moment here is a suggestion of improvement for the coming versions of the Unilogic software which I think it`d be very beneficial and it would enable the capability of the software for the future.
I hope that makes sense.