By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,687 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,687 IT Pros & Developers. It's quick & easy.

Query Help Needed

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John wrote:
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.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You may wish to try:

SELECT job_id
FROM table_name As j
WHERE job_date = (SELECT MAX(job_date) FROM table_name
WHERE job_date <= Date() )

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQhlN1IechKqOuFEgEQK1wwCfYJ6K9kriKnQ1QMr9lOS5mb qdna0An2hq
AEx6LU7spglFv9Iv2kfL704c
=dDjl
-----END PGP SIGNATURE-----
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.