A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find the oldest date in an Access recordset



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2009, 03:45 PM posted to microsoft.public.excel.misc
gab1972
external usenet poster
 
Posts: 7
Default Find the oldest date in an Access recordset

I found some coding to find a date range in an Access recordset, but I
need a macro to search a recordset for the oldest date.

Any help or references would be greatly appreciated...or even a place
to start. My recordset name is rs.

Thanks in advance! I love this community. It's saved my a$$ numerous
times.
  #2  
Old November 18th, 2009, 04:47 PM posted to microsoft.public.excel.misc
mike
external usenet poster
 
Posts: 3,942
Default Find the oldest date in an Access recordset

Why not just have a sql query do it for you.
SELECT Max(Field_Name) AS MaxofField_Name FROM Table_Name;

"gab1972" wrote:

I found some coding to find a date range in an Access recordset, but I
need a macro to search a recordset for the oldest date.

Any help or references would be greatly appreciated...or even a place
to start. My recordset name is rs.

Thanks in advance! I love this community. It's saved my a$$ numerous
times.
.

  #3  
Old November 18th, 2009, 05:46 PM posted to microsoft.public.excel.misc
gab1972
external usenet poster
 
Posts: 7
Default Find the oldest date in an Access recordset

On Nov 18, 11:47*am, Mike wrote:
Why not just have a sql query do it for you.
SELECT Max(Field_Name) AS MaxofField_Name FROM Table_Name;



"gab1972" wrote:
I found some coding to find a date range in an Access recordset, but I
need a macro to search a recordset for the oldest date.


Any help or references would be greatly appreciated...or even a place
to start. *My recordset name is rs.


Thanks in advance! *I love this community. *It's saved my a$$ numerous
times.
.


Is "Maxof..." a part of the equation? My recordset name is
permit_info and the field I'm trying to find the lowest date is
permit_log_date. I want it to find that smallest date and return the
value in permit_num in the same recordset.

I'm not sure how to do that last part, but is this how my sql
statement should look?

str = "SELECT Min(permit_log_date) AS Min of permit_log_date FROM
permit_info"

thanks in advance...
  #4  
Old November 18th, 2009, 06:08 PM posted to microsoft.public.excel.misc
gab1972
external usenet poster
 
Posts: 7
Default Find the oldest date in an Access recordset

One other thing...can I add an AND statement in there?

The criteria should be that I need to find in the recordset
permit_info the permit number (field = permit_num) with the smallest
date (field = permit_log_date) and does not equal "Applicant" in the
field curr_location.

Mike wrote:
Why not just have a sql query do it for you.
SELECT Max(Field_Name) AS MaxofField_Name FROM Table_Name;

"gab1972" wrote:

I found some coding to find a date range in an Access recordset, but I
need a macro to search a recordset for the oldest date.

Any help or references would be greatly appreciated...or even a place
to start. My recordset name is rs.

Thanks in advance! I love this community. It's saved my a$$ numerous
times.
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.