Skip to main content
kavyam0002
Brainy
Jul 11, 2023 9:02 AM UTC
Solved

subtract

Hi,

i'll give any date it has to subtract with today and give me number of days difference

ex: inputdate -today= no of days difference, 04/07/2023- today = 7 days

which functions i can use to achieve this? suggest me

    sanchitg0002
    Inspiring
    Jul 11, 2023 9:15 AM UTC

    No need to use a function for this, just use minus(-) operator between the dates.

    tointeger(ri!input - today())

    Make sure that both the inputs are of Date type.

    5 replies

    sanchitg0002
    Inspiring
    Jul 11, 2023 9:15 AM UTC

    No need to use a function for this, just use minus(-) operator between the dates.

    tointeger(ri!input - today())

    Make sure that both the inputs are of Date type.

    shanmathip7466
    Inspiring
    Jul 11, 2023 9:19 AM UTC

    Or we can use `abs` to not return negative numbers.

    abs(ri!date1-ri!date2)

    New Participant
    Nov 29, 2023 6:39 AM UTC

    @traffic jam 3d You can use the datedif() function in Python's datetime module.

    stefanhelzle0001
    Brainy
    Nov 29, 2023 7:19 AM UTC

    There are no snakes in Appian! And no British comedians!