What's new in Customer Journeys?

Connect and learn more!
SQL to pull Number of Days between two dates (one is a Parameter Date)? — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

SQL to pull Number of Days between two dates (one is a Parameter Date)?

Accepted answer
26
Views
4
Comments

I'm currently using BIP Report. This sequel works on me if I'd like to use SYSDATE:

TO_NUMBER(TRUNC(SYSDATE) - TO_DATE(TO_CHAR(SEN.SENIORITY_DATE, 'YYYY-MM-DD'),'YYYY-MM-DD')) DAYS

However, when I use a date parameter:

TO_NUMBER(TRUNC(:P_DATE) - TO_DATE(TO_CHAR(SEN.SENIORITY_DATE, 'YYYY-MM-DD'),'YYYY-MM-DD')) DAYS

I encountered an error:

ORA-00932: inconsistent datatypes: expected NUMBER got DATE

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!