Finding the next date

sroot

Registered User.
Local time
Yesterday, 20:20
Joined
Mar 18, 2013
Messages
53
Hello. I have to do something and i am not sure if it can even be done. i have 2 tables that i need to get information from. from table one i have a list of dates and i need to get the next available date from table 2... so if table 1 has 5/17/2014 19:47 and the closest date on table 2 is 5/17/2014 22:10 then i would want all the information from that line in the table... is there a way to do this? Thanks
 
Hmm well would this make sence?

SELECT TOP 1 * FROM tbl2 WHERE date > @0 ORDER BY Date ASC
Run that query with your value from the first table.
 

Users who are viewing this thread

Back
Top Bottom