我正在尝试在Access中创建一个查询,该查询将返回日期范围内的成员计数。
TransactionTable
TranID (pk)
ActivityID (fk)
MemberID (fk)
LocationID (fk)
TranDate
TranHours这似乎是可行的:
SELECT Count(*) AS UniqueMembers
FROM (SELECT DISTINCT transid
FROM transactiontable) AS T; 但是当我添加参数日期范围时,我开始感到困惑。
SELECT Count(*) AS UniqueMembers
FROM (SELECT DISTINCT transid
FROM transactiontable) AS T
WHERE ( transactiontable.trandate ) BETWEEN
[enter the start date:] AND [enter the end date:]; 发布于 2013-12-31 06:02:34
将查询更改为在子选择中有WHERE子句。
有点像
SELECT Count(*) AS UniqueMembers
FROM (
SELECT DISTINCT TransID
FROM TransactionTable
WHERE (TransactionTable.TranDate) Between [Enter the start date:] And [Enter the end date:]
) AS T;https://stackoverflow.com/questions/20852559
复制相似问题