Say I have a Recordset that has a Recordcount=20. Then I want a Querydef that pulls just the last six records of this Recordset. How can I do this?
Dan Rogotzke
Dan_Rogotzke@oxy.com
THATS IT! The TOP predicate using ORDER BY DESC! It works perfectly. Although I got it to work with DougP's solution too. I never could figure out (after trying every contortion I could think of) to copy from RS1 to RS2 so I created a temp table and populated it with the last 6 records. But using the Top predicate changed it from 52 lines of code to 18 lines of code. Thank you very much!
Hehahahaha! Yeah, I guess I am kinda obsessed with recordsets. I love the darned things. Hehehahahah! Using your solution I ran a Querydef from the SQL for the report, but now that I think about it I don't need the table or any code at all. I can populate the RecordSource of the report with the SQL containing the TOP predicate. Sheesh! What a deal, ha? Yep, this is definately worth a star. In fact, even though I don't drink I'd buy you a beer.
Dan Rogotzke
Dan_Rogotzke@oxy.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.