Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
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.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working from oldest date Gibbyky2 Excel Worksheet Functions 6 September 15th 09 07:49 AM
How to find most previous or oldest day in a column MSSailor Excel Discussion (Misc queries) 3 March 14th 09 01:46 AM
Find Oldest Date Qaspec Excel Discussion (Misc queries) 7 July 5th 07 10:02 PM
oldest date not completed Dreamstar_1961 Excel Worksheet Functions 7 April 2nd 07 02:46 PM
Need to find oldest date in ever changing list. Alan Anderson via OfficeKB.com Excel Worksheet Functions 5 February 20th 05 05:09 AM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"