Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    99

    Unanswered: revenue per employee

    I'm building a database with company info including revenue and number of employees and I want to get an output based on revenue per employee when both fields are fulfilled....

    Can anyone please help re how to set up this calculation including validation that would not give an output if both fields are not fulfilled...

    I'm guessing it isn't too much of a big brainer but for a bear with little brain and little techie skills I'm stumped so if anyone can start me off in the right direction it would be much appreciated

    thanks :-)
    pachamama
    www.researchbank.co.uk
    Fortune Global 500 Databank

  2. #2
    Join Date
    Jan 2004
    Posts
    492

    Re: revenue per employee

    Originally posted by pachamama
    I'm building a database with company info including revenue and number of employees and I want to get an output based on revenue per employee when both fields are fulfilled....

    Can anyone please help re how to set up this calculation including validation that would not give an output if both fields are not fulfilled...

    I'm guessing it isn't too much of a big brainer but for a bear with little brain and little techie skills I'm stumped so if anyone can start me off in the right direction it would be much appreciated

    thanks :-)

    Ok I think you want the sum of revenue grouped by each employee? If so its something like this:

    Code:
    Select sum(rev.revenue), emp.emp_name
    from revenue rev, employee emp
    where rev.revenue is not null
    and rev.emp_id = emp.emp_id
    group by emp.emp_name
    Assumes you have 2 tables, REV and EMP. Not sure if this is true - If it is in one table, you can take out the join and other table reference.

    I dont understand exactly when either of the fields would be null. Explain a little more the 2 columns, what data they contain, and why you would expect a NULL value.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •