DateDiff (PQL)
Returns the difference between the 2 specified date-time values expressed by the date-part.
- Returned Output: Numeric
- Library: PQL \ Common \ Date-Time
- Version: 2018.00.000
- Compatibility:
- It can be combined with other PQL functions throughout the application.
- It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.
Syntax
* Click on the function’s arguments above for more details on the input values.
Comments
- The 2 date-time input values (representing the “from” and “to” dates) can be any elements that resolve to a date-time values.
- The date-part flag needs to conform to the acceptable types described below.
- The date-part flag must be enclosed in quotation marks " “.
- This function is often used in conjunction with other date-time functions and operations
Date-Part flags
Date-part | Flags |
|---|---|
Years | yyyy,yy,year |
Quarters | qtr,q,quarter |
Months | mm,m, month |
Weeks | wk,ww,w,week |
Days | dd, dayofyear |
Hours | hh, hour |
Minutes | min, mi, minute |
Seconds | ss,s,second |
Milliseconds | ms, millisecond |
Examples
This example returns 2
This example returns 365
This example returns 24