× 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.



You may be better at this than I, since I use SQL embedded in RPG with subroutines for the various SQL functions, such as processing an SQL cursor.

The EXECUTE SQL code chunk refers to variables like
:BEGDAT and :ENDDAT date range where the colon in front says this is a field defined by the RPG program and populated before the SQL invoked.

Thus, this same subroutine can be called many times with different population.

Sometimes I need to walk through data, not via RPG READ one file at a time perspective, but SQL mixture of files selected data perspective, and for that I use SQL cursors, where we can define like a data base within the spectrum of our files ... each input cycle is like a mixture of fields from different files joined in ways unique to this program, and each cycle based on date range, or location, or price, or something other than how the logicals are indexed.

Its been a few weeks since I last posted, and its been a over a week since I
was even at work....actually I kind of missed a lot of you :) Trying to get
some rest and recoup time in a hospital bed just does not seem to ever work.

Alas, I am back, working on another stupid SQL problem.  If someone could
point me in the right direction on this I would appreciate it.

I need to extract a sum of our line items for two separate date ranges, IE:

select sum(ilneprice) as current from speclf where ilninvdate >'02/01/2005'
and ilninvdate <='10/31/2005'

That works just fine, but I also need to extract a sum for the same field
(ilneprice) for a different date range....is it possible to do this without
having to run the query two separate times? Because I also need to extract
some other information and group it by location codes and item numbers....

Any help would be appreciated.

Douglas


If you bought it, it was hauled by a truck - somewhere, sometime.

-
Al Macintyre  http://www.ryze.com/go/Al9Mac
BPCS/400 Computer Janitor ... see
http://radio.weblogs.com/0107846/stories/2002/11/08/bpcsDocSources.html

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.