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 runs in query tool but not Data Model

I need to calculate the number of days a person will work during a pay period. To do this I am calculating the the days from the last day of work through the end of the pay period. The following sql works when I use our sql tool (SQLConnect from Splash BI):

SELECT
DISTINCT PTP.START_DATE,
PTP.END_DATE,
PTP.REGULAR_PROCESS_DATE,
CASE
WHEN PTP.END_DATE >= :P_LAST_WORK_DAY THEN 10
ELSE 0
END AS PENDING_DAYS,
CASE
WHEN PTP.END_DATE > :P_LAST_WORK_DAY AND CAST(TRUNC(:P_LAST_WORK_DAY) - TRUNC(PTP.START_DATE) AS NUMBER) < 2

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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