Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find recent date

Status
Not open for further replies.

jimb0ne

Programmer
Oct 6, 2003
291
0
0
CA
I have a database containing testing information. My problem is that for each test there is an associated date and subtests within that test. A specific subtest may not have been done for a test, if this is the case I want to be able to find the date for the last test like it that was done. Basically I want to know how to be able to find the date in the past that is closest to the date associated with my current test. Does anyone know of a good way to go about this?

Thanks in advance,
James
 
Any chance you could post your tables schema, some input samples and expected result ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi, jimbOne,

PHV is the true SQL master here, and I would do whatever he recommends. But something like this might get you started in the right direction:

SELECT Max(tblMyTable.dtMyDate) AS MaxOfdtMyDate
FROM tblMyTable
WHERE [dtMyDate] < Date();

Ken S.
 
thanks guys, I think I've figured out what I'm gonna do, its not the smoothest way to go about things, but it seems to work. thanks again for the suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top