在MS Access中返回每个组的增量组号

编程入门 行业动态 更新时间:2024-10-24 22:27:38
本文介绍了在MS Access中返回每个组的增量组号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要帮助来在Access中创建一个查询,以递增数量的行组(在一个公共日期进行分组),并使组号"在下一个日期保持递增,如结果"列中所示.

I need help to create a query in Access to incrementally number groups of rows, grouped on a common date and keep the "group numbers" increment on the next date like showing in the Result column.

2017/01/09 | 809 | 1

2017/01/09 |809 | 1

2017/01/09 | 810 | 1

2017/01/09 |810 | 1

2017/01/09 | 826 | 1

2017/01/09 |826 | 1

2017/01/10 | 826 | 2

2017/01/10 |826 | 2

2017/01/11 | 809 | 3

2017/01/11 |809 | 3

2017/01/11 | 810 | 3

2017/01/11 |810 | 3

2013/01/11 | 826 | 3

2013/01/11 |826 | 3

2017/01/12 | 809 | 4

2017/01/12 |809 | 4

2017/01/12 | 810 | 4

2017/01/12 |810 | 4

2017/01/12 | 826 | 4

2017/01/12 |826 | 4

谢谢

推荐答案

这是一种方法: SELECT A.*, (SELECT Count(*) FROM (SELECT DISTINCT [Date] FROM Table1) AS Q1 WHERE A.Date>=[Date]) AS GrpSeq FROM Table1 AS A;

Here is one approach: SELECT A.*, (SELECT Count(*) FROM (SELECT DISTINCT [Date] FROM Table1) AS Q1 WHERE A.Date>=[Date]) AS GrpSeq FROM Table1 AS A;

另一个是报表上组头"中文本框的属性: RunningSum:OverGroup ControlSource:= 1

Another is with properties of textbox in Group Header on report: RunningSum: OverGroup ControlSource: =1

更多推荐

在MS Access中返回每个组的增量组号

本文发布于:2023-11-12 12:44:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581527.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:增量   MS   Access

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!