emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Xin Shi <shixin111@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: How to Calculate duration time in Table ?
Date: Tue, 21 Jul 2009 15:45:48 -0400	[thread overview]
Message-ID: <10926.1248205548@alphaville.usa.hp.com> (raw)
In-Reply-To: Message from Xin Shi <shixin111@gmail.com> of "Tue, 21 Jul 2009 15:06:51 EDT." <5236d6f90907211206y20951c9dtc711cf71afc520e2@mail.gmail.com>

Xin Shi <shixin111@gmail.com> 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

  reply	other threads:[~2009-07-21 19:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 19:06 How to Calculate duration time in Table ? Xin Shi
2009-07-21 19:45 ` Nick Dokos [this message]
2009-07-21 21:37   ` Bastien
2009-07-21 22:49     ` Nick Dokos
2009-07-21 23:47       ` Bastien
2009-07-22  3:32         ` Xin Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10926.1248205548@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=shixin111@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).