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




My problem with your approach, Charles, is that it uses the 
highest date in
the whole LRDETAIL file.  Even if Jay wanted a count of all 
the records on
the highest date, then there still the question: should you limit your
SUBSELECT to only the records that match the original 
selection criteria?
In your case, MAX(LDQDAT) could return a date from a record 
that isn't even
in the select criteria, so the count would be zero!

Yep, but that's how I read his request.


Ah, the joy of SQL.


Now, Joe...lets not blame SQL for the confusion caused by the OP's
description of his requirements not being exact.

Given the same request but using RPG I/O I'd have given him the same
results.  Starting at EOF on LRDETAIL, reading backward though a logical
keyed on LDQDAT, chain to BANKHEDR to check the fields there, stopping
when LDQDAT changed.

Jay how about it?  What exactly are you trying to count?


Charles


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.