|
You need to convert your numeric into a date format. The best syntax I have found is to go through the timestamp function. date( timestamp( digits(hhdob) || '000000' ) ) Mark
date: Wed, 30 Aug 2006 10:55:23 -0500 from: "Dave Boettcher" <DBoettch@xxxxxxxxxxxxxxxx> subject: Calculating difference between dates in SQL hello, I have been experimenting with interactive SQL to try to formulate a statment for later use. What I need to do is calculate an age for a client . The client master contains the birth date in numeric form 8,0. My statement, culled from various books and articles looks like this: SELECT days(current date) - days(date(hhdob)) "Age" , hhdob, hhnaml, hhnamf, hhcase FROM ClientMaster The result always seems to look like this: "Age" BIRTH YYYYMMDD case ++++++++++++++ 19,820,926 4 ++++++++++++++ 19,820,924 5 ++++++++++++++ 19,840,909 6 ++++++++++++++ 19,820,915 7 ++++++++++++++ 19,820,806 8 ++++++++++++++ 19,810,108 9 ++++++++++++++ 19,820,330 10From reading it seems like age should be a number, why can't I see it?Thanks in Advance for any help, Dave Boettcher
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.