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

Max Records Property - Not Working?

Status
Not open for further replies.

hoppergs

IS-IT--Management
Feb 24, 2003
39
GB
I've got a query that I want to restrict so that it only shows one record. Because it is sorted by date in descending order, I'd have thought that if I set the "Max Records" property to 1, then the latest record would be the only one there. WRONG! The query still returns all records - it's like the "Max Records" property isn't being recognised.

Does anyone know if this is a known bug, or if I'm perhaps doing something wrong?

Thanks, Graham
 
You need to group the records by selecting the Total icon in the Query Design mode.

Then, the Max function comes into play in the date field.

What this does is take the maximum date for the grouped records. So, if is everything else in the records are the same, except for the date, in order to get just one result, you need to select one of the aggregate functions:

Max, Min, Count, etc.

Hope this helps! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Graham:

The Max Records property only works when extracting data from an ODBC source.

Try using the Top property in the query properties list and set it equal to 1. The property has several values preprogrammed in, but you can enter any value.

HTH,

Vic
 
Thanks for your quick responses guys - I'll give your suggestions a go.

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top