Good Morning
I have been using Access 2010 to link to and retrieve data from government tables data for over 5,000 organizations. I then export to Excel 2007 to analyze the data. Several Access Tables and Databases contributors taught me how to use criteria in a query to eliminate some of the work in Excel. For example, the tables that I am working with provides the opportunity for each organization to input 100 lines of numbers in two columns representing salary expenses and other expenses (line 95 is a subtotal) followed by line 101, a total. As you will note from the SQL below, I used a Not 09500 criterion which allowed me to sum 1:100 checking to if it equals 101.
SELECT Hosp_2009_NMRCa.RPT_REC_NUM, Hosp_2009_RPTa.PRVDR_NUM, Hosp_2009_NMRCa.WKSHT_CD, Hosp_2009_NMRCa.LINE_NUM, Hosp_2009_NMRCa.CLMN_NUM, Hosp_2009_NMRCa.ITM_VAL_NUM
FROM ([2009 rpt_num 4957] INNER JOIN Hosp_2009_RPTa ON [2009 rpt_num 4957].[2009 RPT_REC_NUM 4957] = Hosp_2009_RPTa.RPT_REC_NUM) INNER JOIN Hosp_2009_NMRCa ON Hosp_2009_RPTa.RPT_REC_NUM = Hosp_2009_NMRCa.RPT_REC_NUM
WHERE (((Hosp_2009_NMRCa.WKSHT_CD)="A000000") AND (Not (Hosp_2009_NMRCa.LINE_NUM)="09500") AND ((Hosp_2009_NMRCa.CLMN_NUM)="0100" Or (Hosp_2009_NMRCa.CLMN_NUM)="0200"));
Now I am wondering can the query design be modified to do the following: (1) eliminate line 95; (2) print out column 1 and 2 and a total (3) check total for each organization sum(1:100=101); and (4) return only those organizations that sum(1:100=101).
Thank you for reading and considering this request.
Al Charbonneau
Bookmarks