From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Problem with date calculations in a table Date: Fri, 15 Aug 2008 07:56:01 -0400 Message-ID: <8931.1218801361@gamaville.dokosmarshall.org> References: <76D4727F59354728AA93049264DCF1F7@CUBE> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTxvs-0001Ge-UM for emacs-orgmode@gnu.org; Fri, 15 Aug 2008 07:57:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTxvr-0001GO-Pn for emacs-orgmode@gnu.org; Fri, 15 Aug 2008 07:57:28 -0400 Received: from [199.232.76.173] (port=49478 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTxvr-0001GJ-J2 for emacs-orgmode@gnu.org; Fri, 15 Aug 2008 07:57:27 -0400 Received: from qmta08.westchester.pa.mail.comcast.net ([76.96.62.80]:40487) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTxvr-0000iV-85 for emacs-orgmode@gnu.org; Fri, 15 Aug 2008 07:57:27 -0400 In-Reply-To: Message from "Chris Randle" of "Fri, 15 Aug 2008 10:24:39 BST." <76D4727F59354728AA93049264DCF1F7@CUBE> 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: Chris Randle Cc: emacs-orgmode@gnu.org Chris Randle wrote: > Nick Dokos wrote: > > I've been trying to make a table with the following structure: column > > 1 contains either a date or is empty; column 2 contains a date that's > > calculated from the corresponding date in column 1 (if column 1 > > contains a date) or is empty (if column 1 is empty). In the example > > below, column 2 is supposed to be the date 12 hours or 0.5 days after > > the date in column 1 (assuming that it is non-empty). > > I had problems getting date arithmetic to work in tables. I posted my > findings and solutions here: > > http://article.gmane.org/gmane.emacs.orgmode/6536/ > > Don't know if it will fix your problem (too lazy to try!) but I suspect > it will. > It did! I don't understand the details yet but the following seems to do what I want: | start | ETA (start + 12 hrs) | |----------------------+------------------------| | 2008-08-14 Thu 18:15 | <2008-08-15 Fri 06:15> | | | | #+TBLFM: $2=(date(<$1>) ? <$1>+0.5 : string("")) The date in the first column can be just a string as above, a passive date or an active date (the file is not in the agenda list so I don't really have to worry about active dates). Thanks very much, Nick