Prev: REMOVING LEADING ZERO
Next: Query null value problem
From: Corey-g via AccessMonster.com on 13 May 2010 12:51 Hi All, Sorry for the 'not so descriptive' subject - but there wasn't enough room to write "Need help with Financial data from multiple tables to follow where a transaction went". :-D I have 8 tables - all identical - for 8 different 'accounts' (not bank accounts, but accounting 'accounts'). I have been asked if I can pull data from the 8 to try and follow a 'transaction' through these accounts. I had thought a crosstab query might do the trick, but was having difficulties in putting it together. So I then started by creating a union (all) query to pull all the data into one set, then crosstab that. Here is what I have for table structure (for all 8 tables): [BookingID],[TransDate],[Descr],[Debit],[Credit] I added a field in the union query to indicate the origin (called 'Origin'), and then added the Debit & Credit amounts together to give just one column - lets call in "TransAmt". So my union looks like this: [Origin],[BookingID],[TransDate],[TransAmt] Now I am doing the crosstab using the [BookingID] as the Row Heading, and the [Origin] as the Column. And I added the [TransDate] as another Row Heading, and did 'Sum' of [TransAmt] as the value. I am getting results, but I'm not 100% sure if they are accurate - so I thought I would ask in anyone thought I did this right or wrong, and any pointers they might have in doing this sort of query. I cringe when they suggest I do it in Excel - so if you have any thoughts or idea's, please feel free to add them!! Thanks in advance, Corey -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201005/1
From: david on 14 May 2010 01:14 Nothing wrong with that. The only problem was the original decision to put different accounts into different tables. It's not too late: you could replace the account tables with account queries and probably no one would notice. Nothing wrong with using Excel to do accounts if you are going to put each account on a separate page. Of course, you are open to inter-page errors (and all the really complex Excel accounts I have dealt with have had complex errors) but--- you get the same kind of errors in Access if you put your different accounts into different tables....... The total should be OK (and you need to audit a single transaction to check that it is ok). The only place you may have problems is when you do complex summation mixed with complex selection mixed with complex selection and complex grouping. Specifically when you have MAX or MIN in the middle of a stack of complex queries. Fortunately, that's quite rare, and in my experience leads to fewers error than complex spread-sheets, but I wish I could say it wasn't broken (david) "Corey-g via AccessMonster.com" <u19162(a)uwe> wrote in message news:a7f36b6b7c3f4(a)uwe... > Hi All, > > Sorry for the 'not so descriptive' subject - but there wasn't enough room > to > write > "Need help with Financial data from multiple tables to follow where a > transaction went". :-D > > I have 8 tables - all identical - for 8 different 'accounts' (not bank > accounts, but accounting 'accounts'). > > I have been asked if I can pull data from the 8 to try and follow a > 'transaction' through these accounts. > > I had thought a crosstab query might do the trick, but was having > difficulties in putting it together. So I then started by creating a > union > (all) query to pull all the data into one set, then crosstab that. > > Here is what I have for table structure (for all 8 tables): > > [BookingID],[TransDate],[Descr],[Debit],[Credit] > > I added a field in the union query to indicate the origin (called > 'Origin'), > and then added the Debit & Credit amounts together to give just one > column - > lets call in "TransAmt". So my union looks like this: > > [Origin],[BookingID],[TransDate],[TransAmt] > > Now I am doing the crosstab using the [BookingID] as the Row Heading, and > the > [Origin] as the Column. And I added the [TransDate] as another Row > Heading, > and did 'Sum' of [TransAmt] as the value. > > I am getting results, but I'm not 100% sure if they are accurate - so I > thought I would ask in anyone thought I did this right or wrong, and any > pointers they might have in doing this sort of query. > > I cringe when they suggest I do it in Excel - so if you have any thoughts > or > idea's, please feel free to add them!! > > Thanks in advance, > > Corey > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201005/1 >
From: Corey-g via AccessMonster.com on 14 May 2010 11:10 Thanks so much for your response David! I actually did just that (put all the data into one table and used the account # as an additional column. This then makes the crosstab query work quite well (in terms of run time), and I am just spot checking some records this morning to ensure I'm getting the right results. Thanks again, Corey david wrote: >Nothing wrong with that. The only problem was the original >decision to put different accounts into different tables. >It's not too late: you could replace the account tables >with account queries and probably no one would notice. > >Nothing wrong with using Excel to do accounts if you >are going to put each account on a separate page. Of >course, you are open to inter-page errors (and all the >really complex Excel accounts I have dealt with have >had complex errors) but--- you get the same kind of >errors in Access if you put your different accounts into >different tables....... > >The total should be OK (and you need to audit a single >transaction to check that it is ok). The only place you >may have problems is when you do complex summation >mixed with complex selection mixed with complex >selection and complex grouping. Specifically when >you have MAX or MIN in the middle of a stack of >complex queries. Fortunately, that's quite rare, and >in my experience leads to fewers error than complex >spread-sheets, but I wish I could say it wasn't broken > >(david) > >> Hi All, >> >[quoted text clipped - 44 lines] >> >> Corey -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201005/1
|
Pages: 1 Prev: REMOVING LEADING ZERO Next: Query null value problem |