Hi all,
I have been struggling for quite some time now with creating a query that would only return the records with the top N values where N is a user supplied parameter. I know I can use the Select Top 5 ... syntax but I have been unable to find a way that would enable users to enter the 5 as a parameter.
As I am not a properly educated programmer I used trial and error and so far I only received error with this one.
I tried to enter it as a SQL parameter with no luck, tried to modify the Querydef from code but it seems the TopValues property can't be modified from code, tried to use the MaxRecords but it seems it only applies to ODBC. And of course searched for a solution on a number of forums.
I would be grateful for any help.
Many thanks.
SWK
I have been struggling for quite some time now with creating a query that would only return the records with the top N values where N is a user supplied parameter. I know I can use the Select Top 5 ... syntax but I have been unable to find a way that would enable users to enter the 5 as a parameter.
As I am not a properly educated programmer I used trial and error and so far I only received error with this one.
I tried to enter it as a SQL parameter with no luck, tried to modify the Querydef from code but it seems the TopValues property can't be modified from code, tried to use the MaxRecords but it seems it only applies to ODBC. And of course searched for a solution on a number of forums.
I would be grateful for any help.
Many thanks.
SWK