westjelly
Board Regular
- Joined
- Jul 5, 2005
- Messages
- 50
Hey all. Part of me writing this out here is getting an idea of where I am in the process. As always, I apologize for the inital "dump" of text. Hoping that it makes some sense 
Outline of below:
1 - Add group by month
2 - Update a master table (Update/Append query)
Presently, a query is run on a SQL database. From there, 4 spreadsheets are exported, giving a look at the data in Monthly, QTD, YTD, and rolling 12-month format. These four files are linked into another spreadsheet, which also links from other spreadsheets. The web of spreadsheets, while perfectly functional, requires too much time to properly maintain.
I'm going to cut out out at least some, if not all, of the intermediate steps by giving a more functional export from the main database or, if and when possible, run the SQL query (or queries) directly from an Access App.
1.
The area I'm looking at right now deals with invoices that have posted between a start_mo and end_mo. Each month, spreadsheets are exported:
YYYYMO - Monthly.xls
YYYYMO - QTD.xls
YYYYMO - YTD.xls
YYYYMO - Rolling12.xls
(ex. 200603 - Monthly, 200603 - QTD.xls, etc.)
Here is the gist of what is contained in each:
Method - Contractor - Specialty - Charges - Hours - Days
Then tabs for Method:
ATM: Contractor - Speciality - Charges
Barter: etc.
Method
ATM
Barter
Charge
Debit
Contractor
Abe
Bob
Charlie
Dennis
Specialty
Aerospace
Butcher
Carpentry
DeepseaDiving
Anyway, what I would like to do is take a single set of data each month (rather than the 4 spreadsheets exports) and just extrapolate Monthly, QTD, YTD, and rolling 12-month from there.
The output would add a "group by month", to give:
Month - Method - Contractor - etc
So the SQL query would need to look at the Invoice post field, and group everything by month. This data goes into a master table in the Access app.
Which brings me to:
2.
I'm planning to have a command button to update the master table. Everytime the update is run, a new record is added to a "UpdateHistory" table, giving me a uniqueID for the date/time/user of the update. Then, when the update is run again, it would import any truly "new" records.
So, if I have, for a query in February:
Then, say in March, something gets changed in the January data, so that I would get:
Note the 200602 entry for Bob. Charges is higher, so the record is appended to the table
From there, I can work with the most recent version of the Month/Method/Contractor, OR, I can cross-reference the UpdateID to recreate reports done at an earlier date.
So, I want the update query to:
1. Compare data from main database to master table
2. If Month, Method, Contractor, Specialty and all other fields (totals of charges, hours, days, etc) are identical --> IGNORE
3. If any of the fields are different --> APPEND to the master table, using the current UpdateID
I'm looking for pointers, ideas, questions for each of these 2 things. If it rings a bell or sounds intriguing (or if you just think I'm off my rocker), let me know? Will be happy to help clarify places where I'm not giving enough information.
Outline of below:
1 - Add group by month
2 - Update a master table (Update/Append query)
Presently, a query is run on a SQL database. From there, 4 spreadsheets are exported, giving a look at the data in Monthly, QTD, YTD, and rolling 12-month format. These four files are linked into another spreadsheet, which also links from other spreadsheets. The web of spreadsheets, while perfectly functional, requires too much time to properly maintain.
I'm going to cut out out at least some, if not all, of the intermediate steps by giving a more functional export from the main database or, if and when possible, run the SQL query (or queries) directly from an Access App.
1.
The area I'm looking at right now deals with invoices that have posted between a start_mo and end_mo. Each month, spreadsheets are exported:
YYYYMO - Monthly.xls
YYYYMO - QTD.xls
YYYYMO - YTD.xls
YYYYMO - Rolling12.xls
(ex. 200603 - Monthly, 200603 - QTD.xls, etc.)
Here is the gist of what is contained in each:
Method - Contractor - Specialty - Charges - Hours - Days
Then tabs for Method:
ATM: Contractor - Speciality - Charges
Barter: etc.
Method
ATM
Barter
Charge
Debit
Contractor
Abe
Bob
Charlie
Dennis
Specialty
Aerospace
Butcher
Carpentry
DeepseaDiving
Anyway, what I would like to do is take a single set of data each month (rather than the 4 spreadsheets exports) and just extrapolate Monthly, QTD, YTD, and rolling 12-month from there.
The output would add a "group by month", to give:
Month - Method - Contractor - etc
So the SQL query would need to look at the Invoice post field, and group everything by month. This data goes into a master table in the Access app.
Which brings me to:
2.
I'm planning to have a command button to update the master table. Everytime the update is run, a new record is added to a "UpdateHistory" table, giving me a uniqueID for the date/time/user of the update. Then, when the update is run again, it would import any truly "new" records.
So, if I have, for a query in February:
Code:
Month - Method - Cont - Specialty - Charges - Hours - Days - UpdateID
200601 - ATM - Bob - Carpentry - $1000 - 10 - 1 - 23
200601 - Barter - Bob - Carpentry - $2000 - 20 - 2 - 23
200601 - ATM - Abe - DeepSeaDiving - $1500 - 15 - 1 - 23
Code:
Month - Method - Cont - Specialty - Charges - Hours - Days - UpdateID
200601 - ATM - Bob - Carpentry - $1000 - 10 - 1 - 23
200601 - Barter - Bob - Carpentry - $2000 - 20 - 2 - 23
200601 - ATM - Abe - DeepSeaDiving - $1500 - 15 - 1 - 23
200601 - ATM - Bob - Carpentry - $1500 - 15 - 1 - 24
200602 - ATM - Bob - Carpentry - $800 - 10 - 1 - 24
200602 - Debit - Dennis - Butcher - $400 - 10 - 1 - 24
Note the 200602 entry for Bob. Charges is higher, so the record is appended to the table
From there, I can work with the most recent version of the Month/Method/Contractor, OR, I can cross-reference the UpdateID to recreate reports done at an earlier date.
So, I want the update query to:
1. Compare data from main database to master table
2. If Month, Method, Contractor, Specialty and all other fields (totals of charges, hours, days, etc) are identical --> IGNORE
3. If any of the fields are different --> APPEND to the master table, using the current UpdateID
I'm looking for pointers, ideas, questions for each of these 2 things. If it rings a bell or sounds intriguing (or if you just think I'm off my rocker), let me know? Will be happy to help clarify places where I'm not giving enough information.