Incorrect Parameter Count Difference Between Dates As A Date
- Incorrect Parameter Count Difference Between Dates As A Date Time
- Incorrect Parameter Count Difference Between Dates As A Date Book
- Incorrect Parameter Count Difference Between Dates As A Date 2016
Using CR 2008 I am using a start date and end date parameter to set the date range in the report selection criteria. Within the report I need to calculate the number of days that the report covers. I know how to write a datediff formula, but I need the datediff between two parameters and t seems that parameters cant be used in formulas. Instead of using one datetime value, it starts off with two values and calculates the interval between them. For example, here I calculate the interval between two dates held as attributes and return the answer in months: So if the two dates were 20170309 and 20170909 then the result would be 6 (or -6, depending on which way round the values were).
I get incorrect results when trying to find numeric difference between two dates:
Between 13.04.2016
and 28.04.2016
I shouldn't get that difference is 3 or 2 days..
I've tried to multiple combinations:
- swap
startDate.diff(endDate)
withendDate.diff(startDate)
format('E')
with something I've come up searching the SO
result: all the time I get that difference is 3 or 2 days.
What am I doing wrong? Thanks in advance.
Incorrect Parameter Count Difference Between Dates As A Date Time
wanttobeprofessionalIncorrect Parameter Count Difference Between Dates As A Date Book
5 Answers
Incorrect Parameter Count Difference Between Dates As A Date 2016
Tweaking.com pro serial lookup. From the moment.js docs: format('E')
stands for day of week. thus your diff is being computed on which day of the week, which has to be between 1 and 7.
From the moment.js docs again, here is what they suggest:
Here is a JSFiddle for your particular case:
Dani Akashthe diff
method returns the difference in milliseconds. Instantiating moment(diff)
isn't meaningful.
You can define a variable :
and then use it like so :
Edit
actually, this is built into the diff
method, dubes' answer is better
Here's how you can get the comprehensive full fledge difference of two dates.