Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

I need formula help please!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Golfinray - 29 Feb 2008 20:16 GMT
I need a formula to do this: I just can't seem to get the syntax right.
We have 2 types of buildings, 1 is permanent, 2 is portable. I am summing
all permanent buildings. I want to add the replacement cost of a portable
building to the replacement cost of the permanent building IF a school has a
portable building. . If a school has 3 permanent buildings and 5 portable
buildings, I want to add the replacement cost of all 5 of the portable
buildings to the already summed cost of the 3 permanent buildings. If a
school has no portable buildings, leave the value alone. Thanks so much!!!
KARL DEWEY - 29 Feb 2008 23:44 GMT
I had to assume your field names and used Golfinray as table name.
SELECT Golfinray.School, Sum(IIf([Type]="1",1,0)) AS Permament,
Sum(IIf([Type]="2",1,0)) AS Portable, Sum(Golfinray.Cost) AS SumOfCost
FROM Golfinray
GROUP BY Golfinray.School;

Signature

KARL DEWEY
Build a little - Test a little

> I need a formula to do this: I just can't seem to get the syntax right.
> We have 2 types of buildings, 1 is permanent, 2 is portable. I am summing
[quoted text clipped - 4 lines]
> buildings to the already summed cost of the 3 permanent buildings. If a
> school has no portable buildings, leave the value alone. Thanks so much!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.