| View previous topic :: View next topic |
| Author |
Message |
FreewayFred Power User

Joined: 22 Feb 2007 Posts: 85 Location: Wisconsin USA
|
Posted: Tue Jun 30, 2009 7:22 am Post subject: top and parameter in a query |
|
|
I'd like to create a query that use both "TOP" and a parameter. It seems as though the HSQL parser doesn't accept a parameter and the base parser doesn't accept "TOP".
Has anyone been able to work around this? |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2474 Location: 3rd Rock From The Sun
|
Posted: Tue Jun 30, 2009 10:44 am Post subject: |
|
|
FreewayFred:
You asked: | FreewayFred wrote: | | Has anyone been able to work around this? |
Yes,
- Create a VIEW using the TOP part of the query, withOUT a 'parameter'.
- Create a QUERY, using the VIEW above with your Parameter Query.
Therefore, you are able to use the 'best' of both worlds . . . while using all the 'tools' of the HSQL engine, and, the tools of Base to create the 'parameter prompt' in the Query.
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title ( edit button ) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
FreewayFred Power User

Joined: 22 Feb 2007 Posts: 85 Location: Wisconsin USA
|
Posted: Wed Jul 01, 2009 3:26 am Post subject: |
|
|
Thanks for the quick reply. After further thought I realized that, since I'm always using the most recent "WeekNumber" as the parameter, I'm going to use a subquery to return the MAX "WeekNumber" instead.
Thanks again. |
|
| Back to top |
|
 |
|