如何根据多个变量检索以前的记录? [英] How can I retrieve a previous record based on multiple variables?
问题描述
我正在尝试在查询中创建一个字段,该字段基本上查找昨天的字段。 特定位置的表现。我读过其他建议使用DLookup的博客;但它是基于一个自动编号Pimary Key。这不会是正确的字段,因为每一行不一定按时间顺序排列。
为了简化 - 我有3个字段[LOCATION],[DATE],[UNITS OPEN]我保留历史的6个不同地点。有没有人知道一个精心设计的表达式,它将匹配Location-1(6)和Location-1(6)并显示前一天的'[OPITS OPEN]?
提前感谢您的任何帮助!
您可以将表格连接到自己的位置和日期之前的日期。
< blockquote>你能详细说明一下吗?
没有太多要详细说明。您只需将我所说的内容转换为SQL语法即可。这样的事情:
展开 | 选择 < span class =codeDivider> | Wrap | 行号
I''m trying to create a field in a Query which essentially looks up "yesterday''s" performance for a "specific location". I''ve read other blogs that suggest a DLookup; however it is being based on an auto number Pimary Key. This will not yeild the correct field as each row is not necessarily in chronological order.
To simplify - I have 3 fields [LOCATION],[DATE],[UNITS OPEN]There are 6 different locations of which i''m keeping history. Does anyone know of an elaborate expression that will match up Location-1(of 6) with Location-1(of 6) and display the prior day''s [UNITS OPEN]?
Thanks in advance for any assistance!解决方案You can join the table to itself on the location and date to prior date.
Can you elaborate a bit more?
There''s not much to elaborate on. You just have to convert what I said into the SQL syntax. Something like this:
Expand|Select|Wrap|Line Numbers
这篇关于如何根据多个变量检索以前的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文