if you're using SQL server then you can use 

DATEDIFF(datepart, startdate, enddate)

look it up in SQL BOL

if not, then do it in CF - with er, um, DateDiff("datepart", "date1",
"date2")

;)

specify the datepart and it'll do it all for you.


> -----Original Message-----
> From: Lovelock, Richard J [mailto:[EMAIL PROTECTED] 
> Sent: 01 October 2003 15:23
> To: 'cflist'
> Subject: [ cf-dev ] Age calculation
> 
> 
> hiya...
>  
> If i have someones DOB in the database - how can i find out 
> their age in years?
>  
> presume I can do some date subtraction using #dob# and 
> #now()# but not sure how to do this syntactically and return 
> an integer year value (or even integer year and days!! e.g 26 
> years 37 days old)
> 
> _______________________________________________________<?xml:namespace
> prefix = o ns = "urn:schemas-microsoft-com:office:office" />
> 
> *  Regards, 
>                 Richard Lovelock 
> 
> Westminster City Council - Web Support
> Cap Gemini Ernst & Young
> Southbank
> 95 Wandsworth Road
> London 
> SW8 2HG 
> 
> (     0870 906 7482
>  
> _______________________________________________________
> 
>  
> 
> 
> **************************************************************
> ******************************
> " This message contains information that may be privileged or 
> confidential and 
> is the property of the Cap Gemini Ernst & Young Group. It is 
> intended only for 
> the person to whom it is addressed. If you are not the 
> intended recipient, you 
> are not authorized to read, print, retain, copy, disseminate, 
> distribute, or use 
> this message or any part thereof. If you receive this message 
> in error, please 
> notify the sender immediately and delete all copies of this message ".
> **************************************************************
> ******************************
> 
> 


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to