cancel
Showing results for 
Search instead for 
Did you mean: 

If with currentDate

Hi,

I'm trying to create a dimention that will return the number of days that a certain contact is open.

This is the formula I wrote:

=If IsNull(CLOSING_DATE]) then CurrentDate() - (OPENING_DATE)

But an error message pops up:

'The expression or sub-expression at position 36 in the '-' function uses an invalid data type. (IES 10037)'

Accepted Solutions (0)

Answers (1)

Answers (1)

swapnil_shewale
Explorer

First of all ISNULL function requires 2 Arguments as mention below.

SELECT ISNULL(Value1, 'ReplaceValueof_Value1');

if you want days difference between two date then you can use function as mention below

SELECT DATEDIFF(DD, Getdate(), '2011/08/25') AS DateDiff;