From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Re: question and use example Date: Wed, 26 Aug 2009 18:32:49 -0400 Message-ID: <11368.1251325969@alphaville.usa.hp.com> References: <20090826163829.GA4578@new-host-2.home> <877hwqpbva.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgR4K-0006Js-Vg for emacs-orgmode@gnu.org; Wed, 26 Aug 2009 18:34:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgR4G-00067t-L0 for emacs-orgmode@gnu.org; Wed, 26 Aug 2009 18:34:16 -0400 Received: from [199.232.76.173] (port=33202 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgR4G-00067Y-HO for emacs-orgmode@gnu.org; Wed, 26 Aug 2009 18:34:12 -0400 Received: from g1t0029.austin.hp.com ([15.216.28.36]:41074) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgR4G-0002YB-5S for emacs-orgmode@gnu.org; Wed, 26 Aug 2009 18:34:12 -0400 In-Reply-To: Message from Benjamin Andresen of "Wed, 26 Aug 2009 22:18:49 +0200." <877hwqpbva.fsf@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: Benjamin Andresen Cc: emacs-orgmode@gnu.org Benjamin Andresen wrote: > Hey Paul, > > Paul Menair writes: > > > My problem is this. I populate the fifth field with c-- c-u c-y. I > > would be nice if it happened automatically, but that's no big deal. > > However, I've been going through and manually entering the sixth > > field, and that does end up being a hassle. > > I whipped something up that should work for you. > Very nice! There is a simpler approach, but with the disadvantage that it requires modifications to the structure of the table (iow, I don't know how to do it with a time range :-) The main simplification is that it uses built-in functions. The table looks like this: | | date | client | desc | start time | end time | duration in dec | H:M | |---+------------------+--------+-------+------------------------+------------------------+-----------------+------| | # | <2009-08-26 Wed> | benny | foo'd | <2009-08-26 Wed 14:45> | <2009-08-26 Wed 18:05> | 3.33 | 3:20 | #+TBLFM: $7=(date(<$6>) - date(<$5>))*24;%.2f :: $8='(org-minutes-to-hh:mm-string (round (* $7 60)));N Note that the primary result is the time interval in decimal hours - the hh:mm result is derived from that. Note also that the rounding is necessary because org-minutes-to-hh:mm-string assumes that its argument is an integer and misbehaves if it is not: (org-minutes-to-hh:mm-string 73.2) --> "1:00" (org-minutes-to-hh:mm-string 73) --> "1:13" I'm sure there are other approaches as well - investigating the built-in clocking and attendant reports is probably a good idea as well. Bernt Hansen has some information in his org-mode page[1], and there is a tutorial about it on worg[2]. HTH, Nick [1] http://doc.norang.ca/org-mode.html [2] http://orgmode.org/worg/org-tutorials/index.php - the tutorial itself is at http://sachachua.com/wp/2007/12/30/clocking-time-with-emacs-org/, but note that it's 1.5 years old and I don't know whether it's still useful or whether it's completely out of date by this time.