If it is a character field, then do this, using an ISO representation - no need to convert explicitly to a date:
select * from yourfilewhere substr(datefld,1,4) || '-' || substr(datefld,5,2) || '-' || substr(datefld,7,2) >=
current date - 1 day If the date field is numeric with 8 digits, use digits(datefld) where I have "datefld" in the example. At 06:19 AM 1/30/2006, you wrote:
Hi, I've got a file containing dates in yyyymmdd format. The date contains entries that are about a year old. I want to use query, if possible, to report on records where the dates are the current date or the current date -1 (yesterday).Does anyone have any examples of how this can be done? Any help appreciated. Thanks -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
This mailing list archive is Copyright 1997-2015 by MIDRANGE dot 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 here. If you have questions about this, please contact