Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am unable to get a result by using this command =DATEDIFF('dd', '2007-08-01', '2007-09-01') in apache openoffice calc.

Even using two columns of dates and using the formula =DATEDIFF('dd','A2','B2'), I am unable to find the difference between dates.

Can anyone help me out?

share|improve this question
add comment

2 Answers 2

DATEDIFF seems to be OpenOffice Base/SQL function, not Calc function. It can be used in Calc as Basic macro custom function.

share|improve this answer
add comment

There's no function named DATEDIFF available from the OpenOffice Calc Date & Time funstions.

Instead, you should use the Calc-specific funtions, for example the DAYS function to calculate the number of days between two dates:

=DAYS("2007-08-01", "2007-09-01")

EDIT: Regarding DATEDIFF: this is a function that's part of the Core SQL:1999 standard (see the overview of date/time sql functions in the SQL Wikibook), so you can use it with most SQL databases (OpenOffice Base, MySQL, PostgreSQL and so on). But you can't use a SQL function natively in Calc.

share|improve this answer
I think there should be double quotes around the dates in your example. –  PleaseStand Jun 19 '12 at 6:45
@PleaseStand: thank you for the hint, you were right. –  tohuwawohu Jun 19 '12 at 16:27
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.