MS访问日期之间的不同问题 [英] MS Access A Different Between Dates Problem
问题描述
首先,谢谢。
我有一张表(A),有近1000个不同的日期。我有另一张表(B),里面有成千上万的记录,每个记录都包含一个From Date。和To Date。我需要找到表A中所有未包含在表B中任何From-To日期之间的记录(日期)。在外行人的术语中,表B中的哪些日期在表B中被遗漏。表B可能有From-To重叠或间隙。表A和表A之间没有关系。 B除了检查表A中的日期是否在表B中任何记录中的From-To之间。
再次,谢谢你的帮助
First, Thank you.
I have a table (A) with close to 1000 distinct dates. I have another table (B) with hundreds of thousands of records, each of which contains a "From Date" and "To Date". I need to find all of the records (Dates) in table A that are not encapsulated between any of the From-To dates in table B. In layman''s terms, which dates in table A were missed in table B. Table B may have From-To overlaps, or gaps. There is no relation between tables A & B other than checking if date in table A is between From-To in any record in table B.
Again, thank you for your help
推荐答案
试试这个SQL:
Try this SQL:
Pat,谢谢。似乎没有工作提示我''tblB.from_date''。 tblB是否需要在FROM子句中引用somehwere?
原始代码似乎已生成一个包含近200万条记录的笛卡尔表格:
Pat, thank you. It seems not to work prompting me for the ''tblB.from_date''. Does tblB need to be referenced in a FROM clause somehwere?
Original code which seems to have produced a cartesian table with almost 2 million records is here:
实际上我给你的SQL有一个小问题。我做了一个更正,现在只是在我的沙盒数据库中测试它。
Pat
Actually there is a small issue with the SQL I gave you. I made a correction and am just testing it out now in my sandbox database.
Pat
这篇关于MS访问日期之间的不同问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!