× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Burns, Bryan wrote:
At the end of every month, I change the record selection date
range in 15 or so queries to reflect the current month in order
to get month-end totals. Is there a way to automate this? Of
course, the files to be queried may be different so the date
fields will not always be the same.


The selection could be encapsulated in logical view(s) of the physical data, and then the query directed against the file with the desired selection; i.e. change the queried file, rather than the selection defined in the query definition. For example, given file DATAFILE create the logical files which define DATAMO01 to DATAMO12, preferably without regard to year, then use RUNQRY QRY(named) QRYFILE(DATAMO##) where DATAMO## is replaced with '01' to '12' according to the desired month-end.

Really there is too little known about the full requirements to know what best to recommend... as can be inferred from the various responses already given. Must the queries remain *QRYDFN objects? Is RUNQRY RCDSLT(*YES) to force prompting not an option? Must no new files be created? No new immediately maintained indexes? Can the range be a function of the current date, or might when the query is run possibly negate that option?

The concept of join to a range which Rob indicated was not very efficient is really not so inefficient as compared to record selection, especially when an index can be used.... because if an index can not be used, the query is probably already inefficient, so that it would be done by join instead to a single-row table is not that problematic. The biggest impact is that the row in the table must be updated before running the queries, which requires its own update, and as already alluded by some, the calculations for what the selection would be has already been done in the program which would make that available directly as variables that could be passed to or used directly in that program to perform the query.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.