to calculate number of days between two dates in dql documentum -
i have 2 attributes, effect_date,next_effect_date. have calculate difference between these 2 dates in days. dql query? please help
use query dm_document
, date properties r_creation_date
, r_modify_date
generic object type & attributes:
select datediff(day, r_creation_date, r_modify_date) dm_document r_object_id = '<set_id_here>'
when specify object type name can adjust query. syntax datediff function datediff(date_part, date1, date2)
result value depends on db under repository. documentation:
if repository using oracle or db2, return value floating point number. if repository using db2, server assumes 365 days per year , 30.42 days per month (the mean number of days in month). these assumptions can cause return values differ expected value. illustrate, following example, asks number of days between march 1, 1996 , feb 1, 1996, returns 30.42 instead of 28: datediff(day, date('03/01/1996 0:0:0'), date('02/01/1996 0:0:0')) if repository using ms sql server, return value integer units except day. if specify day in function, return value floating point. ms sql server implementation round if difference 1 half or greater of specified unit. implementations round down if difference less 1 half of specified unit. illustrate, following example, asks difference between march 1, 1996 , july 1, 1996 expressed years, returns 0 because difference 4 months. datediff(year,date('03/01/1996'),date('07/01/1996'))
Comments
Post a Comment