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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Max Date

Status
Not open for further replies.

Tronsliver

Technical User
Sep 19, 2000
120
US
I have a query with 4 fields one of which is a date field. Each month I add ten records all with the same date. As it stands right now I have 30 records with each group of ten having the same date. What can I put it the date field criteria to get the latest group of dates only? I don't want to use a SQL query because I can't access the fields in my form controls.
 
You should be able to add a SELECT statement as the criteria for your date field in your query. Along with your other fields your date field in your query would have a criteria of:

(SELECT max(dt) from Table1)

where dt is the name of your date field & Table1 is the name of the table that your query is based on. If your field names contain spaces you'll need to enclose in square brackets like:

(SELECT max([dt]) FROM Table1)

This should only return rows where the date is equal to the maximum date entered. Note: you have to include the outer parentheses.

Hope this helps....

jj
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top