CRV_SQL_CURVE_PKG.SUM is not returning correct value
search cancel

CRV_SQL_CURVE_PKG.SUM is not returning correct value

book

Article ID: 272428

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

CRV_SQL_CURVE_PKG.SUM(PRCALENDAR.ODF_CALENDAR, LS.WBC_LEAVE_START, TRUNC(LS.WBC_LEAVE_END) + 1) returns 0 or incorrect hours when the Monday is a Non working day and the Leave start date is on Friday. 

 

Environment

All Clarity Releases 

Cause

CRV_SQL_CURVE_PKG.SUM is a pretty old package used in Clarity and there is a preparsed SQL curve used since 15.* release and its advised to use the new package. 

Resolution

NK_PARSE_CURVE_FCT is the new sql curve which should be used for accurate and faster results. 

The above query should be rewritten as 

nk_sum_fct(odf_nk_calendar, LS.WBC_LEAVE_START, TRUNC(LS.WBC_LEAVE_END) + 1) / 3600, 2)