# Using Calcdate

##### Tags:

- C/AL

##### Categories:

- Best Practice

CALCDATE should only be used with DateFormula variables. Alternatively the string should be enclosed using the <> symbols.

Bad code

    IF ReservEntry."Expected Receipt Date" >
        CALCDATE('-' + FORMAT("Dampener (Time)") + FirstDate)
    THEN

Good code

    IF ReservEntry."Expected Receipt Date" >
        CALCDATE('<-' + FORMAT("Dampener (Time)") + FirstDate + '>')
    THEN

Last modified February 24, 2022: Added tags & categories + cleanup (5ee04366) by waldo1001