I'm paraphrasing from the DS390 documentation.......
If the default date format specified in project or job properties is 'YYYY-MM-DD', then CAST('2005-01-01' AS DATE) converts '2005-01-01' to a Date data type.
In DS390, when you move a Date data type to an Integer (w/o a date mask), the Date is converted to an Integer that represents the day number, where days are numbered sequentially from 0001-01-01 (which is day number 1).
If DAYS_DIFF is defined as an Integer, then I'm a little confused why it can't be derived as e.g., CAST(<date format 1> AS DATE) - CAST(<date format 2> AS DATE)
![Confused :?](./images/smilies/icon_confused.gif)