What we have is a table that contains data for multiple sub accounts. Right now we are using a make table query to manually make a new table from each of the sub accounts so that they can be exported for some other stuff. The current table has 33 sub accounts. What we would like to do is have the query automaticaly make a separate table for each sub account.
The field that is used to specify the sub accounts is CLaims.T01CLILO and the new tables named the same as the T01CLILO.
Any help will be appreciated.
Thank you
The field that is used to specify the sub accounts is CLaims.T01CLILO and the new tables named the same as the T01CLILO.
Code:
SELECT DISTINCT CLaims.T01CLINO, CLaims.T01CLILO, CLaims.T01STATE, CLaims.T01DESM, CLaims.T01CLINOP, CLaims.T01CLILOP, CLaims.[T01REPT#], CLaims.T01DATE0, CLaims.T01BYEY, CLaims.T01SSN, CLaims.T01NAM, CLaims.T01TCODE, CLaims.T01AMT, CLaims.T01HRG, CLaims.T01EXBSTS, CLaims.T01EXCSTS, CLaims.T01EX2STS, CLaims.T01ROPSTS, CLaims.T01CRIRP, CLaims.T01CHGTC, CLaims.T01CRTC, CLaims.T01PROTC, CLaims.T02REPDAT, CLaims.T02REPEND, CLaims.T02REPPER, CLaims.T02NOLOCS, CLaims.T02DSTOFF, CLaims.T02CATEG, CLaims.Lastfour, CLaims.recoded, CLaims.LDW, CLaims.Date_Entered, CLaims.T02NAMM INTO [Report Temp]
FROM CLaims INNER JOIN [Report Select] ON (CLaims.T01CLILO = [Report Select].R_Clilo) AND (CLaims.T01CLINO = [Report Select].R_Clino)
WHERE (((CLaims.T01DATE0)<[Report Select].[R_E_Date]) AND ((CLaims.T01BYEY)>[Report Select].[R_B_Date]));
Any help will be appreciated.
Thank you