Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    If then statement in query

    Hello everyone,



    I am working on a datbase that contains leaks on engines. On one column of the database the leak status can be entered as "active" or "repaired". The next column over will have the leak rate in cfm (cubic feet per minute). I am trying to write a query that will sum the leak rate of active leaks in one column and the leak rate of repaired leake in another.

    Something like if "leak status"="repaired" then SUM column

    and in the next column on the query if "leak status"="active" then SUM column

    I have used if then statements before, just not in access. Any help would be appreciated.

    Thanks

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109

    Not quite what you asked for, but what about...

    running a Totals query where you 'group by' [leak status] and sum on [leak rate]? Each row will display the sum of the leak rates per leak status category.

    If you only need this information for a form or report, you could create a field(s) using Dsum in the control field.
    ex. Dsum([leak rate], "tablename","[leak status] = 'active'")

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Syntax Error In Insert Into Statement
    By frankvfox in forum Queries
    Replies: 1
    Last Post: 09-09-2008, 12:35 PM
  2. Replies: 0
    Last Post: 05-17-2008, 01:18 AM
  3. IF Statement with Minutes
    By sal_gxer in forum Queries
    Replies: 0
    Last Post: 02-12-2007, 08:39 AM
  4. multiple iif statement NEED HELP PLZ
    By scott munkirs in forum Reports
    Replies: 1
    Last Post: 09-27-2006, 05:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums