Query Help Needed

J

John

Hi

I have a table of job ids and dates. What query will get me the job id of
the earliest job after yesterday i.e. a job that is either today, or if
there is no job today, a job that is as soon as possible after today.

Thanks

Regards
 
K

Ken Snell [MVP]

SELECT JobID, JobDate
FROM Jobs
WHERE JobDate =
(SELECT Min(T.JobDate)
FROM Jobs AS T
WHERE T.JobDate>=Date()
AND T.JobID=Jobs.JobID);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top