N
Need2Know
Good Morning All, Is there a more efficient method of finding closest
date between unrelated tables? Any assistance provided is greatly
appreciated. Thank you all in advance.
SELECT TOP 1 tbl1.[SomeDte], tbl2.[SomeOthDte]
FROM tbl1, tbl2
WHERE tbl1.[SomeDte] < tbl2.[SomeOthDte] And tbl2.[SomeOthDte]
Between tbl2.[SomeOthDte] And tbl1.[SomeDte]
ORDER BY tbl1.[SomeDte] DESC;
tbl1 tbl2
SomeDte SomeOthDte
IgnoreDte Field1
Field2
Field3
date between unrelated tables? Any assistance provided is greatly
appreciated. Thank you all in advance.
SELECT TOP 1 tbl1.[SomeDte], tbl2.[SomeOthDte]
FROM tbl1, tbl2
WHERE tbl1.[SomeDte] < tbl2.[SomeOthDte] And tbl2.[SomeOthDte]
Between tbl2.[SomeOthDte] And tbl1.[SomeDte]
ORDER BY tbl1.[SomeDte] DESC;
tbl1 tbl2
SomeDte SomeOthDte
IgnoreDte Field1
Field2
Field3