Datediff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-10-17 07:52 PM
I need to work out the number of weeks between 2 dates. In v5 I could use Datediff even though it said it going to be deprecated. It doesn't work at all in v6. What is the alternative?
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-10-17 08:27 PM
I'm using a beta version of 6.1 and datadiff still works for me, which is just as well as it would break a lot of stuff if support for it was suddently removed. DateDiff(1, [Date1], [Date2]) returned the number of weeks between the two dates.
What are you seeing when you try to use it?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-06-18 02:42 AM
Is DateDiff() something to disappear in BP v6?
Would be an important point to keep in mind when migrating from BP v5 to BPv6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-06-18 07:50 PM
No it will still be there, it's just recommended not to use it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-06-18 01:53 PM
Do you need the number of days remainder as well? If you want to avoid DateDiff(), something like a calculation stage with [Date Start]-[Date End]/7 will give you number of weeks then it's your choice what to do with the remainder.

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-10-18 07:24 PM
Even i am facing same issue... my calculation stage with datediff funtion was working fine in v5. But when migrated to v6, its giving below error as below:
The following errors exist:
Expression uses the function DateDiff, which is deprecated
Let me know if you have any fix for it. Not sure if it is just a compilation error in calculation stage and will not occur in runtime.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-10-18 07:39 PM
Hi Gourav,
That's a validation that is (at least in my installation) set to Severity 'Warning', which you can ignore for now. It would be a good idea to adjust code over time to not use any deprecated methods, but I would be more concerned about validations with the Severity 'Error'.
If you go to the System tab > Audit group > Design Control > Stage Validation > Advanced, the ""Expression... uses the function ..., which is deprecated"" warning can be changed to 'Advice' severity or unchecked completely. It's probably best not to change this. I only bring it up in case it's a requirement for you guys before code promotion is approved.
Respectfully,
Dave
Dave Morris, 3Ci at Southern Company
Dave Morris, 3Ci at Southern Company
