Christopher Jordan wrote:
> DateDiff("yyyy", Date1, Date2)
>
> Where Date1 and Date2 are valid CF Date/Time objects.
>
> the datepart "yyyy" is in years.
> the datepart "y" is days of the year (1-365?) same as "d" for days.
Just a note since he didn't say if he wanted to do this on the CF side,
or the db side...
CF...
#datediff("yyyy","12/31/2006","1/1/2007")# = 0
SQL Server...
SELECT datediff(yyyy,'12/31/2006','1/1/2007') = 1
SQL Server is counting thresholds, whereas CF is counting whole units.
I believe that is also the behavior in Access. The MySQL datediff
function is only for whole days, and I'm not sure if Postgres has one.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265240
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4