Forum Discussion

ukluk's avatar
ukluk
Regular Visitor
9 years ago
Solved

MIN or MAX value between current row and scalar?

My task is simple yet I cannot find the answer.

 

I want to return the ExpirationDate value for each row, but if it has not yet expired, then return NOW()

 

In C# myDate = Math.Min(expirationDate, Now())

 

The MIN aggregator is looking for the entire table, but I just want to apply the comparison for each row agains a scalar.

 

Thanks,

Uri

  • Create a new column like:

     

    Column = IF(ISNULL([expirationDate]),NOW(),[expirationDate])

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Create a new column like:

     

    Column = IF(ISNULL([expirationDate]),NOW(),[expirationDate])