Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Reports

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-05-2010, 07:38 PM
pshawk pshawk is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 6
pshawk is on a distinguished road
Default sum of columns dependant on other form answers

i have a table and form set up for tracking requests for money. each person can request 5 times (on the same form) and each time the money may come from one of three accounts. the table is set up with value lists for the account names. so there is columns for

account 1
amount 1
account 2
amount 2
etc

i need to generate a report that sums the amount that has been requested of each account. i am at a loss on how to make this happen.

i know the way to say it is

Sum "amount 1" if account = "account name" + sum "amount 2" if account = "account name"
Reply With Quote
  #2  
Old 02-07-2010, 03:39 PM
llkhoutx llkhoutx is offline Windows Vista Access 2007 (version 12.0)
Expert
 
Join Date: Jan 2010
Location: Houston, Texas USA
Posts: 340
llkhoutx is on a distinguished road
Default

Code:
Sum "amount 1" if account "account name" sum "amount 2" if account =  "account name" 
makes no sense.

Build the requisite value in an additional column using a conditional IIF if you recordsource (I assume you have a report); sum that column.
Reply With Quote
  #3  
Old 02-23-2010, 07:47 AM
pshawk pshawk is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 6
pshawk is on a distinguished road
Default

thank you for replying, what would that look like? do i make a query with all of the fields and then a report off of the query?

it has been a long time since i used access and i need it spelled out for me, thanks
Reply With Quote
  #4  
Old 02-23-2010, 07:53 AM
llkhoutx llkhoutx is offline Windows Vista Access 2007 (version 12.0)
Expert
 
Join Date: Jan 2010
Location: Houston, Texas USA
Posts: 340
llkhoutx is on a distinguished road
Default

It's a nested conditional iff.
Code:
iif(condition1,sum1,iif(condition2,sum2,"")) 
Reply With Quote
  #5  
Old 02-23-2010, 08:10 AM
pshawk pshawk is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 6
pshawk is on a distinguished road
Default

do i need to bracket or quote the conditions
Reply With Quote
  #6  
Old 02-23-2010, 08:20 AM
pshawk pshawk is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 6
pshawk is on a distinguished road
Default

do i do this in the report design view, if so is it in the footer or the detail.
Reply With Quote
  #7  
Old 02-28-2010, 02:46 PM
pshawk pshawk is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 6
pshawk is on a distinguished road
Default

i kept google-ing and finally was able to figure it out

sum(iif([fund 1]="soc",[amount 1],0)+iif([fund 2]="soc",[amount 2],0))

luckily i figured out a better way to organize my tables so that there is a one to many relationship and now i dont have to repete the logic over and over again
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keying in Test Answers from Hard Copy CityOfKalamazoo Forms 4 12-07-2009 09:44 AM
Noob needing answers sartan2002 Access 0 10-13-2009 06:39 AM
Change the display of Yes/No answers winter Forms 2 08-11-2009 07:06 AM
Adding Two Columns arthura Queries 6 05-01-2009 06:38 PM
Continuous Subforms Filter Dependant Combo BigBear Forms 0 04-19-2009 06:13 AM


All times are GMT -8. The time now is 08:31 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.