SRod Posted January 18, 2020 Report Share Posted January 18, 2020 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.USRIDWHERE a.USRID IS NOT NULLORDER 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.