MS Access中的页码组

问题描述 投票:0回答:1

Please find the below picture

可以在MS Access查询中进行。请帮助我解决此问题。

Page     Page Breakup
0        0-20
21       21-50
51       51-100
101      101-500
501      500 >
ms-access access-vba
1个回答
0
投票

此查询将执行此操作:

SELECT 
    PageGroup.Page, 
    IIf(
        (Select First(Page) From PageGroup As T Where T.Page > PageGroup.Page) Is Null,
        CStr([Page] - 1) & " >",
        CStr([Page]) & "-" & (Select Min(Page) - 1 From PageGroup As T Where T.Page > PageGroup.Page)) AS [Page Breakup]
FROM 
    PageGroup;
© www.soinside.com 2019 - 2024. All rights reserved.