Code:
I am having huge problem with trying to execute a query it just does not make a table...
What exactly are you trying to do?
Insert results of query into NEW table (SELECT ... Into NewTable ...)?
Insert results of query into EXISTING table (INSERT INTO ExistingTable SELECT ...)?
Anything other?
Anyway, storing aggregate values (SUM and Summary Percentage) in some table is a way for disaster! Let's assume you did this. And later you added a new row to table tblEvent, or edited an entry there, or deleted a row - i.e. did anything in this table. Your data in table where you stored those aggregate values will be off unless you clear affected part or all info (it works in both ways, you have to use the one which works faster) from this table, and fill deleted info anew (or fill the table anew). And when ttblEvent has many rows, this may take a lot of time (and this will happen after any change in tblEvent).
This database's slowing down (plus a possibilty to get wrong aggregate values stored anyway, as nothing is 100% sure), it the reason tis in not recommended. Instead you calculate those aggregates whenever they are needed. E.g. you can create a saved query which does it, and you can anytime get them from there. Something like
Code:
SELECT Tops_AZPU_AG, EVENT_DATE, SUM(KH_Logged) AS KH_SUM
FROM tblEvent
GROUP BY Tops_AZPU_AG, EVENT_DATE