Not in proper code but here's the logic I would follow:
fromDate = 1/1/07;toDate - 2/8/08;
// get the years differenceyearsDiff = datediff('y',fromDate,toDate);
// add that to the from datefromDate = dateAdd('y', yearsDiff, fromDate);
// get the months differencemonthsDiff = datediff('m', fromDate, toDate);
// add that to the from datefromDate = dateAdd('m', monthsDiff, fromDate);
// get the days differencedaysDiff = dateDiff('d', fromDate, toDate);

Hope that helps.
----------

Jake Churchill 
 Team Leader
11204 Davenport, Ste. 100
Omaha, NE  68154 
http://www.cfwebtools.com   
 402-408-3733 x103 

----------------------------------------
From: Steve Sequenzia <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2008 2:54 PM
To: CF-Talk <[email protected]>
Subject: Datadiff and years, months, days 

I posted this yesterday but I don't see any trace of it hitting the list, so if 
it is a  double post I apologize.

I am trying to use the Datediff function to determine the years, months, days 
between to days. Example - from 1/1/08 to 2/9/08 is 1 years 2 months 8 days. I 
am trying to figure out how to do that programmatically. Right now I can only 
come up with the totals months and the total days between two dates. I cannot 
figure out how to get it in the format I need.

Any help on this would be great.

Thanks! 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298677
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to