我如何计算MS Access中每个月的利润? [英] How do I calculate a profit for each month in MS Access?

查看:335
本文介绍了我如何计算MS Access中每个月的利润?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很新,并且正在为我的公司创建数据库。



我有一个'Jobs'表,其中包含以下字段:


  • 作业
  • 启动的年份

  • 启动月份

  • 公司编号

  • 职位描述

  • 金额报价

  • 发票金额

  • 发票号码

  • 完成者

  • 成本

  • 利润


    我想知道的是什么是最好的方式/我如何计算表格或查询每个月的整体利润?



    请大家帮忙,数据库真的会出现,除此之外,这个数据库还是非常强大的。

    解决方案

    您想查找匹配特定年份/月份的所有行,并将该月的所有利润条目汇总在一起总共?

    如果是这样,试试这个:

      select sum (利润),年份= 2013,月= 02 

    或者,如果您想要检索一年中所有月份的信息,请尝试以下内容:

     从年份中选择年份,月份,总和(利润)月


    I'm quite new to access and I am currently in the process of making a database for my company.

    I have a 'Jobs' table with these fields in:

    • Job No.
    • Year Initiated
    • Month Initiated
    • Company ID
    • Job Description
    • Amount Quoted
    • Amount to Invoice
    • Invoice Number
    • Completed By
    • Cost
    • Profit

    What I want to know Is what is the best way/ how do I calculate either in a form or query the overall profit for each month?

    Please help, the database is really coming along, apart from this is well entruely stuck on.

    解决方案

    You want to find all rows matching a specific year / month, and add together all the profit entries for that month to get a total?

    If so, try this :

    select sum(profit) from Jobs where year = 2013 and month = 02
    

    Or, if you want to retrieve this information for all months in one go, try this :

    select year, month, sum(profit) from Jobs group by year, month
    

    这篇关于我如何计算MS Access中每个月的利润?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆