Article View: borland.public.vdbase.data.sql
Article #258Re: Obtaining Age
From: Gerald Lightsey
Date: Sat, 19 Dec 1998 00:00
Date: Sat, 19 Dec 1998 00:00
22 lines
1203 bytes
1203 bytes
In article <367b1a23.10660941@forums.borland.com>,
supportInfo@borland.com says...
> >Given a field DOB in MYTABLE containing Date of birth, what would be the
> >proper local SQL syntax to obtain AGE?
>
> As Geoff points out, the routines in the dUFLP library will handle
> DOB, and is NOT SQL/XDML specific ... just pass the date value ...
>
Ken and Geoff,
Local SQL doesn't seem to want to let me use dBASE functions like FLOOR()
and Val() within its SELECT statement. By the way, I need a VdB 5.6
solution.
Using Mytable->dob
Today = date()
DUFLPAge = floor( ( val( dtos( date() ) );
- val( dtos( Mytable->dob ) ) ) / 10000 )
SELECT <?> as Age from Mytable
Gerald
Technical Details
Message-ID:
<MPG.10e60f20e28f90ab9897d5@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<MPG.10e4a81d2baa73d39897d4@forums.borland.com> <367b1a23.10660941@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,13e5acd5c576586a X-Google-Attributes: gidff5a1,public From: glightsey@cari.net (Gerald Lightsey) Subject: Re: Obtaining Age Date: 1998/12/19 Message-ID: <MPG.10e60f20e28f90ab9897d5@forums.borland.com> X-Deja-AN: 424116257 References: <MPG.10e4a81d2baa73d39897d4@forums.borland.com> <367b1a23.10660941@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.vdbase.data.sql