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
Tagged:
0