如何为排名分配值 - Access 2010 [英] How to assign a value to a rank - Access 2010

查看:86
本文介绍了如何为排名分配值 - Access 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我一直在网上搜索,试图找到如何构建表达式来排列个人按日期销售的机器数量并为排名分配点数 - 所以他卖出了最多6个点,第2个4积分,3分3分,4分2分5分1分。


这就是我的查询设置方式

Hello, I''ve been trawling the web trying to find how to build the expression to rank how many machines an individual has sold by date and to assign points for the ranks - so he who sold the most 6points, 2nd 4 points, 3rd 3 points, 4th 2 points 5th 1 point.

This is how my query is set out

推荐答案

就像错误所说的那样。如果要将子查询用作字段,则只能返回一个字段。此外,将子查询用作字段时,只能返回一行。因为你正在做一个排名字段,我认为你会使用一个计数并将子查询绑定回外部查询。但是你似乎没有这样做。

It''s just as the error says. You can only return one field if you''re going to use a subquery as a field. Also, when using subqueries as field, you must return only one row. Since you''re doing a ranking field, I would think you would use a count and tie the subquery back to the outer query. But you don''t seem to be doing this.

展开 | 选择 | Wrap | 行号


感谢您的快速回复 - 卖家在每周销售表中没有计算销售额,这是在查询中完成的 - 我也看不到您在提到的代码中对日期的引用 - 您是否能够根据我提供的图像使用字段名称?
thanks for the quick reply - the sales are not totalled by seller in the weekly sales table, that is done in the query - also i see no reference to date in your sugested code - are you able to use the field names as per the images i provided?


我的代码只是一个如何设置排名字段的示例。它具有所需要的基础知识,你必须根据自己的需要对其进行修改。


我无法看到图像。我认为这是因为我在工作中使用的浏览器。
My code was just an example of how you would set up a ranking field. It has the basics of what is needed, you would have to modify it to your needs though.

I am unable to see the images. I think it is because of the browser I use at work.


这篇关于如何为排名分配值 - Access 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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