|
michaelu30
Starting Member
2 Posts |
Posted - 2009-03-31 : 13:34:02
|
| DROP TABLE KudlerFoods_Accounts;CREATE TABLE KudlerFoods_Accounts (Account VARCHAR(60) not null Primary KEY,Description VARCHAR(100) not null,Short_Description VARCHAR(200) not null,Balance MONEY null );INSERT INTO KudlerFoods_Accounts (Account,Description,Short_Description,Balance)SELECT 100001,'Petty Cash','Operating Cash-La Jolla',NULLUNION ALLSELECT 100002,'Petty Cash','Operating Cash-Del Mar',NULLUNION ALLSELECT 100003,'Petty Cash','Operating Cash-Encinitas',NULLUNION ALLSELECT 100010,'La Jolla Undeposited Receipts','Undeposited Receipts',NULLUNION ALLSELECT 100011,'Del Mar Undeposited Receipts','Undeposited Receipts',NULLUNION ALLSELECT 100012,'Encinitas Undeposited Receipts','Undeposited Receipts',NULLUNION ALLSELECT 100020,'Bradley Bank','Checking Accounting-La Jolla',NULLUNION ALLSELECT 100021,'Kelsey Bank','Checking Accounting-Del Mar',NULLUNION ALLSELECT 100022,'Downey Bank','Checking Accounting-Encinitas',NULLUNION ALLSELECT 100030,'La Jolla-Payroll','Bank Account',NULLUNION ALLSELECT 100031,'Del Mar-Payroll','Bank Account',NULLUNION ALLSELECT 100032,'Encinitas-Payroll','Bank Account',NULLUNION ALLSELECT 111000,'Accounts Receivable','La Jolla',NULLUNION ALLSELECT 111001,'Reserve for Bad Debts','La Jolla',NULLUNION ALLSELECT 112000,'Accounts Receivable','Del Mar',NULLUNION ALLSELECT 112001,'Reserve for Bad Debts','Del Mar',NULLUNION ALLSELECT 113000,'Accounts Receivable','Encinitas',NULLUNION ALLSELECT 113001,'Reserve fpr Bad Debts','Encinitas',NULLUNION ALLSELECT 121000,'Rustic Baguette','La Jolla Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 121001,'Challah','La Jolla Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 121002,'Calamata Olive Bread','La Jolla Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 121003,'Ciabatta','La Jolla Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 121004,'Ficelle','La Jolla Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 131000,'Angus Beef','La Jolla Meat & Seafood Merchandise Inventory',NULLUNION ALLSELECT 131001,'Wild Turkey','La Jolla Meat & Seafood Merchandise Inventory',NULLUNION ALLSELECT 131002,'Duck','La Jolla Meat & Seafood Merchandise Inventory',NULLUNION ALLSELECT 131003,'Pheasant','La Jolla Meat & Seafood Merchandise Inventory',NULLUNION ALLSELECT 131004,'Quail','La Jolla Meat & Seafood Merchandise Inventory',NULLUNION ALLSELECT 141000,'Rustic Baguette','Encinitas Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 141001,'Challah','Encinitas Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 141002,'Calamata Olive Bread','Encinitas Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 141003,'Ciabatta','Encinitas Bakery Department Merchandise Inventory',NULLUNION ALLSELECT 141004,'Ficelle','Encinitas Bakery Department Merchandise Inventory',NULL;Update KudlerFoods_AccountsSET Balance= 15000 WHERE Account=100001;Update KudlerFoods_AccountsSET Balance= 24000WHERE Account=100002;Update KudlerFoods_AccountsSET Balance= 60000WHERE Account=100003;Update KudlerFoods_AccountsSET Balance= 36000 WHERE Account=100010;Update KudlerFoods_AccountsSET Balance= 27000 WHERE Account=100011;Update KudlerFoods_AccountsSET Balance= 44000WHERE Account=100012;Update KudlerFoods_AccountsSET Balance= 120000WHERE Account=100020;Update KudlerFoods_AccountsSET Balance= 175000WHERE Account=100021;Update KudlerFoods_AccountsSET Balance= 225000 WHERE Account=100022;Update KudlerFoods_AccountsSET Balance= 300000WHERE Account=100030;Update KudlerFoods_AccountsSET Balance= 400000WHERE Account=100031;Update KudlerFoods_AccountsSET Balance= 425000 WHERE Account=100032;Update KudlerFoods_AccountsSET Balance= 95000WHERE Account=111000;Update KudlerFoods_AccountsSET Balance= 30000WHERE Account=111001;Update KudlerFoods_AccountsSET Balance= 72000WHERE Account=112000;Update KudlerFoods_AccountsSET Balance= 40000WHERE Account=112001;Update KudlerFoods_AccountsSET Balance= 136000 WHERE Account=113000;Update KudlerFoods_AccountsSET Balance= 50000WHERE Account=113001;Update KudlerFoods_AccountsSET Balance= 5000WHERE Account=121000;Update KudlerFoods_AccountsSET Balance= 2000 WHERE Account=121001;Update KudlerFoods_AccountsSET Balance= 1300 WHERE Account=121002;Update KudlerFoods_AccountsSET Balance= 1000WHERE Account=121003;Update KudlerFoods_AccountsSET Balance= 1600WHERE Account=121004;Update KudlerFoods_AccountsSET Balance= 1400WHERE Account=131000;Update KudlerFoods_AccountsSET Balance= 2700 WHERE Account=131001;Update KudlerFoods_AccountsSET Balance= 2300WHERE Account=131002;Update KudlerFoods_AccountsSET Balance= 1700WHERE Account=131003;Update KudlerFoods_AccountsSET Balance= 2400 WHERE Account=131004;Update KudlerFoods_AccountsSET Balance= 3000WHERE Account=141000;Update KudlerFoods_AccountsSET Balance= 1900WHERE Account=141001;Update KudlerFoods_AccountsSET Balance= 2900WHERE Account=141002;Update KudlerFoods_AccountsSET Balance= 3100WHERE Account=141003;Update KudlerFoods_AccountsSET Balance=1200WHERE Account=141004;I need my format to be Account Description Short Description Balance10101010101010Subtotal11111111SubtotalGrand Total at the endMy two attempts are as follows:Select Account, Description, Short_Description,BalanceFROM KudlerFoods_AccountsWHERE Account LIKE '10%'COMPUTE SUM(Balance);Select Account, Description, Short_Description,BalanceFROM KudlerFoods_AccountsWHERE Account LIKE '11%'COMPUTE SUM(Balance);Select Account, Description, Short_Description,BalanceFROM KudlerFoods_AccountsWHERE Account LIKE '12%'COMPUTE SUM(Balance);Select Account, Description, Short_Description,BalanceFROM KudlerFoods_AccountsWHERE Account LIKE '13%'COMPUTE SUM(Balance);Select Account, Description, Short_Description,BalanceFROM KudlerFoods_AccountsWHERE Account LIKE '14%'COMPUTE SUM(Balance);SELECT Account, Description,Short_Description,SUM(Balance)FROM KudlerFoods_AccountsGROUP BY Account,Description,Short_Description,Balance with RollupORDER BY 1;I'm not getting anywhere close here....please help!!! |
|