如何使用序列号对查询中的不同字段进行排序? [英] How to use sequential numbers to sort different fields in a Query?

查看:75
本文介绍了如何使用序列号对查询中的不同字段进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为Raceresults1Q的查询。还有一份名为Raceresults1R的报告。我想基于3个字段对此查询进行排序,但是按特定顺序排序。有关清晰,请参见随附的屏幕图


在第一个屏幕图片中我只有最短到最长序列完成比赛的时间。


在第二屏幕图片中,我添加了第1-10场比赛的总体位置,类别位置和性别位置。

必须显示我的结果在报告中称为Raceresults1R。它易于获得整体位置 - 在文本框的控制源中使用= 1。


其他2个排序位置是我的问题。


i刚刚在迷你版本中重建我的数据库,为您提供访问权限的想法还有。

顶部表中的结果能否以报告格式显示,如屏幕图的下表所示?

请帮助。


**编辑**

I have a query called "Raceresults1Q" and a report called Raceresults1R. I would like to sort this query based on 3 fields, but in a specific sequence. See attached screen pic for clarity.

In the first screen pic i only have the times it took to finish the race in shortest to longest sequence.

In the 2nd screen pic i have added the overall position in race 1-10,the Category position and the gender position.
My results must be displayed in the Report called Raceresults1R. Its easy to get overall position - use =1 in control source of a textbox.

The other 2 sorting positions are my problems.

i have just reconstructed my db in a mini version, to give you the idea in access also.
Can the results in the top table be displayed in a Report format as shown in the bottom table of screen pic?
please help.

** Edit **

附加图像
(20.1 KB,101 views)
Attached Images
(20.1 KB, 101 views)

推荐答案

订阅,将返回...


有一件事我忘了提到你可以有10到16种不同根据是否为比赛输入了很多不同的年龄,所有类别都混在一起。我在这个例子中使用了2。
One thing i forgot to mention is that you can have between 10-16 different categories, that are all mixed up depending whether a lot of different ages entered for the race. I used 2 in this example.


坏消息是,我可能没有基于SQL的解决方案!对不起,但SQL并不是我的专业领域。也许这个领域的一个更合格的会员将指出你正确的方向。好消息是我有一个基于代码的解决方案,基于以下逻辑:
The bad news is that there is probably an SQL based solution that I ain''t got! Sorry, but SQL isn''t exactly my area of expertise. Perhaps one of the more qualified Members in this area will point you in the right direction. The good news is that I do have a Code based solution based on the following Logic:
  1. 根据resultsdata表创建一个Recordset。
  2. 根据记录位置,[性别]和[类别]字段上的特定标准递增变量,动态更新[OverallPosition],[GenderPosition]和[CategoryPosition]字段。
  3. 打开报告其记录源是最近更新过的结果数据表。

我将发布代码以及我用于获得此线程解决方案的演示(附件)。 />

I''ll Post the Code as well as a Demo (Attachment) that I used to arrive at a solution for this Thread.

展开 | 选择 | Wrap | 行号


这篇关于如何使用序列号对查询中的不同字段进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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