{"title":"DateFormula data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/dateformula/dateformula-data-type/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/dateformula/dateformula-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/dateformula/dateformula-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Represents a date formula that has the same capabilities as an ordinary input string for the CALCDATE Method (Date).","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Remarks","slug":"remarks","at":280,"chars":795},{"level":2,"title":"Example","slug":"example","at":1075,"chars":446},{"level":2,"title":"Related information","slug":"related-information","at":1521,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nRepresents a date formula that has the same capabilities as an ordinary input string for the CALCDATE Method (Date). The DateFormula data type is used to provide multilanguage capabilities to the CALCDATE Method (Date).\n## Remarks\nWhen a date calculation formula is stored in a DateFormula field, it's converted to a generic, nonlanguage dependent format. When a date calculation formula is retrieved from a DateFormula field, it's converted to a valid date conversion string for the currently selected language.\nTo assign a value to a DateFormula data type, whether it's a field or a variable, you must use the ../system/system-evaluate-method.\nThe following table shows the syntax that's used to create the date formula.\nSyntax|Description\n30D|30 days\n2W|Two weeks\nCM+10D|Current month plus 10 days\nCM+1M|Current month plus one month\nCQ+1M+20D|Current quarter plus one month plus 20 days\nCW+1W|Current week plus one week\nD15|On the 15th of each month\nIn Business Central, weeks begin on Monday and end on Sunday.\n## Example\nThis example requires that you create a DateFormulaVariable variable that is a DateFormula data type.\n```al\nif Format(DateFormulaVariable) = '' then\n  Evaluate(DateFormulaVariable, '<1W>');\n```\nYou must use the ../system/system-format-joker-integer-string-method to make a comparison with a text string. If you don't use this method, then the if statement fails because you can't compare a DateFormula data type with a Text data type.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}