Skip to main content
Solved

how to calculate days between two dates? my pql getting wrong number

  • April 30, 2026
  • 1 reply
  • 11 views

raji970779
Level 4
Forum|alt.badge.img

hello team, i want to find how many days between invoice date and clear date in olap table. i just do "clear date" - "invoice date" but the result is weird very big numbers like millions. i just want normal days count. what is wrong with my code please help me

Best answer by gagan1

hey ​@raji970779 !

when u just subtract two dates with a minus sign celonis calculates the difference in milliseconds. thats why ur getting those massive numbers.

you just need to use the native function for this. try replacing your code with this:
DAYS_BETWEEN("Table"."Invoice Date", "Table"."Clear Date")

just make sure u put your actual table names in there. that will give u the exact day count.

take care

1 reply

gagan1
Level 9
Forum|alt.badge.img+3
  • Level 9
  • Answer
  • April 30, 2026

hey ​@raji970779 !

when u just subtract two dates with a minus sign celonis calculates the difference in milliseconds. thats why ur getting those massive numbers.

you just need to use the native function for this. try replacing your code with this:
DAYS_BETWEEN("Table"."Invoice Date", "Table"."Clear Date")

just make sure u put your actual table names in there. that will give u the exact day count.

take care