开发者

How to sort by summed column in access?

I can't figure this out. I have a query pulling data from a couple sources. The first two columns are [Number of Questions Asked] and [Here's More Clicked]. The third column is a sum of these two columns, [Total Hits]. I'm trying to order by this summed total column.

However, when I do my ORDER BY [Total Hits] DESC and run the query, the query asks me to enter [Total Hits]. What am I doing wrong?

[Total Hits] is a variable created in the query. I'm doing the following to calculate [Total Hits] in the query.

(IIf(IsNull([Number of Questions Asked]),0,[Number of Questions Asked])+IIf(IsNull([Here's More Clicked]),0,[Here's More Clicked])) AS [Total Hit开发者_如何学编程s]


not sure, and its been a while using Access. However, can you specify the oridinal column position that your "Total Hits" column represents in the query... ex: if its the 5th field, use "order by 5"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜