【发布时间】:2020-04-25 06:08:04
【问题描述】:
我有一个返回以下字段的查询:
AccountNumAccountDescriptionAccountGroupIDAccountGroupDescriptionStoreName
我需要这样的报告
- 这些行是由
AccountGroupDescription分组的AccountNum-AccountDescriptions,由AccountGroupID排序 - 列是
StoreNames
它将用于比较每个商店针对给定 AccountGroup 使用的帐户 - 所有商店都使用帐户组来标准化报告。
以下 Access 交叉表查询接近我想要实现的目标,但不确定如何列出每个帐户组的每个商店下的帐号,而不是计算它们。
谢谢!
TRANSFORM Count(qryAccountNbrsByStore.[Account#]) AS [CountOfAccount#]
SELECT qryAccountNbrsByStore.[CFS LineItem]
FROM qryAccountNbrsByStore
GROUP BY qryAccountNbrsByStore.[CFS LineItem]
PIVOT qryAccountNbrsByStore.StoreName;
编辑 4/22 下午 2:00
查询结果数据示例
StoreName AccountNumber AccountGroup
StoreName1 H237 1-AccountsPayable
StoreName1 H240 1-AccountsPayable
StoreName1 H345 2-AccountsReceivable
StoreName1 H348 2-AccountsReceivable
StoreName1 H351 2-AccountsReceivable
StoreName1 H357 2-AccountsReceivable
StoreName1 H445 3-AccruedExpenses
StoreName1 H460 3-AccruedExpensese
StoreName2 F340 1-AccountsPayable
StoreName2 F349 1-AccountsPayable
StoreName2 F456 2-AccountsReceivable
StoreName2 F459 2-AccountsReceivable
StoreName2 F461 2-AccountsReceivable
StoreName2 F564 3-AccruedExpenses
StoreName3 C123 1-AccountsPayable
StoreName3 C235 2-AccountsReceivable
StoreName3 C238 2-AccountsReceivable
StoreName3 C333 3-AccruedExpenses
所需的报告输出:
每个 AccountGrouping 下的 accountNumbers 旨在显示在 StoreNames 下。
-
应付账款
StoreName1 StoreName2 StoreName3 H237 F340 C123 H240 F349 -
应收账款
StoreName1 StoreName2 StoreName3 H345 F456 C235 H348 F459 C238 H351 F461 H357 -
应计费用
StoreName1 StoreName2 StoreName3 H445 F564 C333 H460
【问题讨论】:
-
样本数据和所需结果的示例将大有帮助。