'Adding Parameter to DateDiff Function
Not sure I am going at this the best way, I would like to make the last parameter of the DateDiff formula something the user enters. I get the parameter popup, but when I enter the desired date in the popup I get an error (screen shot of error is below):
Interest Days: DateDiff("d",Nz([Loan]![SetupDate],DateAdd("m",-1,[Loan]![CreationDate])),Format([Enter the date you wish to pull from],"mm/dd/yyyy")+1)
I have tried putting a # in the parameter popup and I also tried not putting the parameter in a Format, like this but it results in the same error:
Interest Days: DateDiff("d",Nz([Loan]![SetupDate],DateAdd("m",-1,[Loan]![CreationDate])),[Enter the date you wish to pull from]+1)
Solution 1:[1]
First, specify the Parameter as DateTime:
[Enter the date you wish to pull from]
Next, use it as a date:
Interest Days: DateDiff("d",Nz([Loan]![SetupDate],DateAdd("m",-1,[Loan]![CreationDate])),[Enter the date you wish to pull from])+1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gustav |
