We help IT Professionals succeed at work.

ORDER BY in Recordset filter

mcrmg
mcrmg asked
on
Medium Priority
1,540 Views
Last Modified: 2012-08-14
Hi,

Does ORDER BY work in recordset filter??  I tried it, but it did not???  Thanks
Comment
Watch Question

TimCotteeHead of Software Services

Commented:
Hi mcrmg,

No but it should preserve any existing orderby clause used to generate the base recordset.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com

Author

Commented:
So, if I want to change order, I can not use filter??
CERTIFIED EXPERT

Commented:
filter will just Filter by field you may wanna change the recordsource and then requery
TimCotteeHead of Software Services

Commented:
mcrmg,

No, all this does is a apply a filter as the name suggests. If you want to change the order you need to requery with a different order by clause or display the data in a control that supports sorting.

Tim.
CERTIFIED EXPERT
Top Expert 2005

Commented:
It is generally best not to use the filter. Here is why:

If you want certain records in a certain order, using a specific SQL select will bring only those necessary records into the recordset. If, however, you use the filter, you bring over all records to the recordset and then filter out the unnecessary records. This is not an efficient way to do things.

FtB
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
@fritz_the_blank,

What if it always return, say, 100 records, I just want to see that in different order??

Author

Commented:
@fritz_the_blank,

What if it always return, say, 100 records, I just want to see that in different order??
CERTIFIED EXPERT
Top Expert 2005
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
pardon me, AlfaNoMore completely had it covered ;)
(I just like to type)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.