If the result is off by one day or less, it is usually a timezone issue. You may be able to adjust by using SET_TIMEZONE().
When comparing date fields, check the display settings for all fields involved. Some fields may be set to GMT while others may be set to local time.
If you want to add a duration to a date-only field to get a date/time result, remember that the date-only field is GMT midnight. You will also need to compensate for your local timezone offset, which can vary throughout the year depending on daylight savings time.
If a date input is missing, date functions will produce an error. Test if the date field has a value before using it in a date function.
If the options for formatting the formula as a date do not appear, the result is not a date or date/time. Check if the formula produces a text string as any possible result, including a blank text string, and rewrite the formula so that the formula always produces a date.
Do not confuse DATETIME_FORMAT() and DATETIME_PARSE(). Use DATETIME_FORMAT() to convert a date object to a text string. Use DATETIME_PARSE() to convert a text string to a date object.
The order of the inputs for DATETIME_DIFF() and WORKDAY_DIFF() are different. DATETIME_DIFF() usually has an end date followed by a start date. WORKDAY_DIFF() usually has a start date followed by an end date.
Duration fields are stored in seconds. When adding a duration to date/time field, set the units to seconds.