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


  • Subject: Re: Query/400 and dates
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Tue, 10 Mar 98 10:35:09 +1100

//--- forwarded letter -------------------------------------------------------
> X-Mailer: Mozilla 3.04 (Win95; I)
> Date: Mon, 09 Mar 98 00:30:58 -0500
> From: boothm@ibm.net
> To: MIDRANGE-L@midrange.com
> Reply-To: MIDRANGE-L@midrange.com
> Subject: Re: Query/400 and dates

> 
> I couldn't answer sooner  -  my motherboard and hard drive died a
> painful and agonizing death.
> 
> Thank you for the answer to this problem for us.
> 
> Actully, as near as we could find, this worked very well.  Years seemed
> to be correct, even when the birthday hadn't happened yet.  One change
> we made that worked was in the substring.  I have changed it here; note
> the '19' and note that I removed the "digits" keyword.
> 
> 
> Simon Coulter wrote:
> 
> > Assuming your job date format is *MDY
> > 
> > AGE = YEAR(CURRENT(DATE) - DATE(SUBSTR(BIRTHDT, 3 ,2) || '/' ||
> >                                 SUBSTR(BIRTHDT, 5 ,2) || '/' ||'19'||
> >                                 SUBSTR(BIRTHDT, 1 ,2) ) )

Hello Booth,

Well I'm surprised the YEAR function gives the correct value but it's 
interesting to know.  I 
assumed your BIRTHDT field was numeric hence the DIGITS function.

Can you be sure about the '19'.  It'll be OK at the moment but in a couple of 
years ....

Anyway I'm glad it helped.

Regards,
Simon Coulter.

//----------------------------------------------------------
// FlyByNight Software         AS/400 Technical Specialists
// Phone: +61 3 9419 0175      Mobile: +61 3 0411 091 400
// Fax:   +61 3 9419 0175      E-mail: shc@flybynight.com.au
// 
// Windoze should not be open at Warp speed.
 

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@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 thread ...


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.