SYMPTOM:
In Strategy, users may find that running a report against an Oracle warehouse results in the error shown below when the report contains an object using the DaysBetween() function:

ORA-00932: inconsistent datatypes: expected NUMBER got DATE
The object used in the report is defined with a DaysBetween function; One or both of the inputs (in the example below Date1 or Date2) metrics, attributes or facts may have a data type that is not compatible with the DaysBetween function. As an example consider either Date1 or Date2 defined as ApplySimple(“TO_CHAR(SYSDATE, ‘DD-Mon-YYYY’)”,) as shown below:

An example of the SQL generated for the metric is shown below:
create table ZZMD00 nologging as select a11.COLUMN_ID CL_ID, max(a11.A_DATE) WJXBFS1 from TABLEA a11 where a11.TYPE= 1 group by a11.CL_ID create table ZZMD01 nologging as select a11.COLUMN_ID CL_ID TO_CHAR(SYSDATE, 'DD-Mon-YYYY') WJXBFS1 from TABLE1 a11 group by a11.CL_ID select distinct coalesce(pa11.CL_ID, pa12.CL_ID) CL_ID, (TRUNC(pa12.WJXBFS1) - TRUNC(pa11.WJXBFS1)) WJXBFS1

Or
