|
SQL may be able to change that into a date field that you can sort by but I have to wonder why that type of field wasn't caught during Y2K remediation? If nothing else, you could always build a work file with that field in a true date format and use it to print the report. The problem with both of these methods are going to be that they're slow since a full table scan is required to do the sort or build the file (you may be able to use a trigger to keep the work file up to date after the initial build). IMHO, the best way to handle this is going to be storing the date in a real date field or at least something that you can sort on like yyyymmdd format. A real date field would have the benefit of not needing a bunch of logic in programs to do things like put date separators in it. This is, however, a ton of work since I'm sure large portions of your system touch the files the invoice data is in. Matt -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of steema@xxxxxxxxxxxxx Sent: Thursday, December 22, 2005 4:24 PM To: RPG programming on the AS400 / iSeries Subject: Re: Opnqryf Now the dilema is how to get a mmddyy field to flow by year. I will do a logical if need be, Strictly speaking, OPNQRYF is not appropriate for RPG400-L ... it would > be better in MIDRANGE-L (http://lists.midrange.com/listinfo/midrange-l). > > However, that line can be blurry, so I'm not going to insist. > > david > > steema@xxxxxxxxxxxxx wrote: >> HI I Have a file that is sorted by invoice number. The requirements for >> the reprt are to list details by year. Yet the date is not part of the >> key. >> I tried an OPNQRYF using the date as the key, but this was ignored. >> >> Did I do this wrong, or is there no way to do this w/out creating >> another >> logical? >> >> Thanks, >> Steve > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
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.