From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How to Calculate duration time in Table ? Date: Tue, 21 Jul 2009 15:45:48 -0400 Message-ID: <10926.1248205548@alphaville.usa.hp.com> References: <5236d6f90907211206y20951c9dtc711cf71afc520e2@mail.gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTLIh-0002MM-4S for emacs-orgmode@gnu.org; Tue, 21 Jul 2009 15:46:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTLIc-0002Lc-4P for emacs-orgmode@gnu.org; Tue, 21 Jul 2009 15:46:58 -0400 Received: from [199.232.76.173] (port=51223 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTLIb-0002LZ-U0 for emacs-orgmode@gnu.org; Tue, 21 Jul 2009 15:46:53 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:42178) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTLIb-00034j-I3 for emacs-orgmode@gnu.org; Tue, 21 Jul 2009 15:46:53 -0400 In-Reply-To: Message from Xin Shi of "Tue, 21 Jul 2009 15:06:51 EDT." <5236d6f90907211206y20951c9dtc711cf71afc520e2@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xin Shi Cc: emacs-orgmode Xin Shi wrote: > I have a table in org which stores the date, I'm wondering if there is any > function to calculate the duration? For example: > > | Start Date | End Date | Duration | > |------------+------------+----------| > | 2004.08.07 | 2005.07.08 | | > > I tried to use B&-C&, but failed ... > Try the following: | Start Date | End Date | Duration | |------------+------------+----------| | 2004.08.07 | 2005.07.08 | 335 | #+TBLFM: $3=(date(<$2>)-date(<$1>)) See this thread: http://thread.gmane.org/gmane.emacs.orgmode/7741 as well as this post (which is really a followup on the above): http://article.gmane.org/gmane.emacs.orgmode/7753 The problem that this last article pointed out was solved in http://article.gmane.org/gmane.emacs.orgmode/8001 and Chris Randle's original musings are at http://article.gmane.org/gmane.emacs.orgmode/6536/ HTH, Nick