cancel
Showing results for 
Search instead for 
Did you mean: 

Datediff

CarolLippert
Level 2
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

Denis__Dennehy
Level 15
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?

AlexanderBopp
Level 4
Is DateDiff() something to disappear in BP v6? Would be an important point to keep in mind when migrating from BP v5 to BPv6

John__Carter
Staff
Staff
No it will still be there, it's just recommended not to use it.

NicholasBell1
Level 3
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
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.

DaveMorris
Level 14
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 Atlanta, GA