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

Unable to get results with multiple attempts at this!!!

Status
Not open for further replies.

Shigg9423

Technical User
Oct 23, 2000
1
US
I have a table with three fields. One of the fields is a date field (format #yyyy#), another is an ID field and the last is a "Type" field.

I am trying to return the type associated with the latest record based on the date field.

I only want one ID to show.

Therefore, the record should be:
(one ID, Date, Type) [sig][/sig]
 
The easiest way IMHO, is to create a query, sort on date (descending), and choose the top 1 record to be returned. You choose top 1, by changing the All in the dropdown box on the menubar to a 1.

Hope that helps.

Kathryn


 
But ... if the date field is truly just the #yyyy#, then the 'Top' record may not be the latest ... ????

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Michael,

Good catch! I skimmed right over the format.



Kathryn


 
Is that because format("YYYY") makes it text? Then I would suggest also having a column in the query that is left as a date field for sorting purposes, and then following the suggestion above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top