Date calculation

Viewing 4 reply threads
  • Author
    Posts
  • December 8, 2021 at 6:39 AM #45982

    John McArthur
    Participant

    Hi,

    Can anyone enlighten if there is a date subtraction calculation facility?
    I want to create a new date by subtracting x amount of days from a specific date from another field.
    Ever the optimist, I thought it might be as simple as DATEADD(OLDDATE-42) but I’m wrong. :-)

    Thanks in advance.

    December 8, 2021 at 10:12 AM #45983

    Daniel Leu
    Participant

    You are almost there. Try this: DATEADD([DATEFIELD];0;0;0;-42;0;0;0) with return type date.

    • This reply was modified 2 years, 4 months ago by Daniel Leu.
    December 8, 2021 at 1:16 PM #45985

    John McArthur
    Participant

    Thanks for the prompt reply Daniel.

    The result does return a value but it only shows the Year. How can I get the full date in the format dd-mm-yy?

    Thanks

    December 8, 2021 at 2:28 PM #45986

    Sam Moffatt
    Participant

    Double check the format settings on your calculation field to make sure they’re set to the format you want. The settings are at the bottom of the field settings area when the field is selected (you’ll have to scroll a bit).

    December 8, 2021 at 3:02 PM #45987

    John McArthur
    Participant

    Thanks Sam. Spot on.
    Although the return value appeared to be showing the year only, the actual form was showing the full date.
    All sorted, many thanks.

Viewing 4 reply threads

You must be logged in to reply to this topic.