I have the following mySQL query below:
select FROM_UNIXTIME(ArchiveDate/1000) AS "Date_Time", totalEventValue, eventCount, totaleventValue/eventCount as AverageTime, serverGroupName from 1142** where ***** = "102" and (***** = "TLB Telehouse" or ***** = "BlueSquare")
However, the data I need comes from many different tables depending on the week number from Jan 2001. For eg. this weeks data comes from 1142** and the previous week would come from 1141**.
How do I create a query that automatically updates the table name (1142) to the current week number once a new week has started (1143)?
I understand that Dynamic Query may be able to help with this but not sure how to go about this.
Thanks, DJ