Choose different table in Query from Combo box

irade92

Registered User.
Local time
Today, 20:16
Joined
Dec 26, 2010
Messages
229
Hi
This is SQL view of a Query based upon one table, i.e tblMAFAKTUR
This Query is used in a Report
I want instead of tblMAFAKTUR to be any table choosed from COMBO box that have exactly the same structure. Let assume that this table has data from January 2010.. I have a least 11 tables left to choose instead of tblMAFAKTUR
Please help
........
SELECT tblMAFAKTUR.OPSTINA, tblMAFAKTUR.MESTO, tblMAFAKTUR.NAZIV, Sum(tblMAFAKTUR.KOL) AS SumOfKOL, tblMAFAKTUR.TEN_CENA, Sum(tblMAFAKTUR.TEN_CENA) AS SumOfTEN_CENA, Sum(tblMAFAKTUR.MARZA) AS SumOfMARZA, Sum([TEN_CENA]+[MARZA]) AS OSNOV_DDV, Sum(([TEN_CENA]+[MARZA])*0.05) AS DDV, Sum(tblMAFAKTUR.PROD_VRE) AS SumOfPROD_VRE, Sum(tblMAFAKTUR.PARTIC) AS SumOfPARTIC
FROM tblMAFAKTUR
GROUP BY tblMAFAKTUR.OPSTINA, tblMAFAKTUR.MESTO, tblMAFAKTUR.NAZIV, tblMAFAKTUR.TEN_CENA
HAVING (((tblMAFAKTUR.OPSTINA)=[Forms]![frmFAKTURA_edna]![cboOSIFRA]) AND ((tblMAFAKTUR.MESTO) Is Not Null));
 
A propery designed database should be Normalised and not have lots of tables with the same strcture.
 
A propery designed database should be Normalised and not have lots of tables with the same strcture.

Thanks Rabbie..seems to be reasonable..I just wanted the data to be separated by month, the reason is if I loose data I will loose from one month only...
Well I will folow the rule..
Thanks again
 
If you backup your database file at regular intervals you should never lose a lot of data when the worst happens
 

Users who are viewing this thread

Back
Top Bottom