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

Access problem

P: 1
I have a query with two fields. One of them shows date and the other shows an object. Now soppose I want to select an object with the latest date. How can I put a criteria for the date field that gives me the latest date. For making my question clear please look at the below example:
field1 field2
1/1/2004 a
1/1/2005 a
1/1/2006 a

In the above example I want to get boject "a" with the latest date, 1/1/2006.
Sep 10 '06 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,997
If you express your date as a time_t variable, which holds the number of seconds passed since Midnight on the 1st January 1970 then you can do a simple binary compare, later dates have higher values.

If instead of 1/1/2006 you express your date as 2006/1/1 (YYY/MM/DD) then you can do a string compare.
Sep 10 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.