I'm sure there is a really simple solution for this matter, but I have tried all I know without success.

I'm trying to modify this working SQL string to yield only the Top 25 results, not all results.

"SELECT * FROM" & "data.CSV" & "ORDER BY " & "Elapsed" & " DESC "*

For the Top 25 SQL syntax I have tested:

"SELECT TOP 25 FROM " & "data.CSV" & " ORDER BY " & "Elapsed" & " DESC "
"SELECT TOP 25 * FROM " & "data.CSV" & "ORDER BY " & "ELAPSED" & DESC "
"SELECT TOP 25" & " ORDER BY " & "ELAPSED" & " DESC " & FROM" & " data.CSV"

None of these three produce any results from the 45 line data file. No errors indicated, all compile.*

Any advice appreciated.

Used

"SELECT TOP 25 * FROM data.CSV ORDER BY Elapsed DESC"

And randomized the test dataset for the Elapsed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.