DATEDIF to Calculate Difference of two Date Fields in BASE

I’ve done lots of searching and I’m coming up with no answers, so I turn to you.

I’ve got a table for dates of transplants for plants. I want to have fields that show the difference between these dates automatically when you pull a query.

When I try to do something like this:

SELECT DATEDIF( "MainHarvest"."Clone Date", "MainHarvest"."Solo Date", "y" ) "STUFF" FROM "StrainLink", "MainHarvest"

I get an error message that says:

Access is Denied: DATEDIF in statement….

I’ve tried a million different ways to do this. I tried “DATEDIFF” as well because there’s lots of documentation on it which doesn’t seem to do anything.

So what am I doing wrong? I’m new to LO and Base, as well as new to SQL.



Syntax DATEDIFF ( <field>, <datetime value expr 1>, <datetime value expr 2> )

  • Use " around Fields names
  • Use ' around keywords

So something like:

SELECT DATEDIFF('dd', "Clone Date", "Sole Date" ) "STUFF" FROM "MainHarvest"