|
"Dennis Lovelady" <dennis@lovelady.com> wrote: >>Greater than 19 (not 20) >>and greater than 99. > >Different columns are being compared. It's cool. :^) Sorry, Dennis, I'm not with you. How can any valid year have a century part greater than "19" and a year part greater than "99"? No records will pass. Assume our comparison date is CCYY. To test equal: Century=CC AND Year=YY To test greater than: Century>CC OR (Century=CC AND Year>YY) To test less than: Century<CC OR (Century=CC AND Year<YY) This should work for any date including the edge cases 1999 and 2000. Health warning - the following code has not been tested - that's Booth's problem. :-) = 1999 I C 117 118 EQC19 IAC 54 55 EQC99 =2000 I C 117 118 EQC20 IAC 54 55 EQC00 >1999 I C 117 118 GTC19 I C 117 118 EQC19 IAC 54 55 GTC99 >2000 I C 117 118 GTC20 I C 117 118 EQC20 IAC 54 55 GTC00 <1999 I C 117 118 LTC19 I C 117 118 EQC19 IAC 54 55 LTC99 <2000 I C 117 118 LTC20 I C 117 118 EQC20 IAC 54 55 LTC00 You can also do the comparisons perfectly well if you are using date windowing with no explicit century, but then it really gets interesting. Answers on a postcard, please. Dave Kahn, ABB Steward Ltd. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.