Answer the question
In order to leave comments, you need to log in
How to choose the required DateTime?
How to select one table (A) id, where Datetime will be taken from another table (B) in between.
Between DatetimeB and DatetimeB -10 hours.
Select A.id
From Accounts A
join Boo B on A.id = B.id and A.datetime between B.datetime -'10:00' and B.datetime
Answer the question
In order to leave comments, you need to log in
SELECT Accounts.id
FROM Accounts
INNER JOIN Boo ON Accounts.id = Boo.id
WHERE Accounts.[datetime] BETWEEN DATEADD(hh, -10, Boo.[datetime]) AND Boo.[datetime]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question