SQL = "SELECT DISTINCT ANNO FROM VIAGGIANTI_PTF ORDER BY ANNO"
i use thsi to selct distinct drom field ANNo but is very slow with 560.xxx records in fileds hereis other way(?!)
VBA code for Excel...
speed up distinct selection....
-
- Administrator
- Posts: 78575
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: speed up distinct selection....
Do you have an index on the ANNO field? That should help.
Try either
SQL = "SELECT DISTINCT ANNO FROM VIAGGIANTI_PTF"
or
SQL = "SELECT ANNO FROM VIAGGIANTI_PTF GROUP BY ANNO"
If those aren't fast enough, you'll have to move to a faster computer or a faster database system.
Try either
SQL = "SELECT DISTINCT ANNO FROM VIAGGIANTI_PTF"
or
SQL = "SELECT ANNO FROM VIAGGIANTI_PTF GROUP BY ANNO"
If those aren't fast enough, you'll have to move to a faster computer or a faster database system.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: speed up distinct selection....
Yes i have index on ANNO and peraphs the second is a few fast!HansV wrote:Do you have an index on the ANNO field? That should help.
Try either
SQL = "SELECT DISTINCT ANNO FROM VIAGGIANTI_PTF"
or
SQL = "SELECT ANNO FROM VIAGGIANTI_PTF GROUP BY ANNO"
If those aren't fast enough, you'll have to move to a faster computer or a faster database system.