DATE FORMULAS in Business Central

Mastering Date Formulas in Business Central: Rules, Variables, and Fun with Time!

If you’ve spent any time in Microsoft Dynamics 365 Business Central, you know that date formulas are the secret sauce to streamlining many processes. Whether you’re filtering reports, automating tasks, or just trying to look super smart in front of your coworkers, date formulas are here to save the day. Let’s break it all down!


The Basics: What Are Date Formulas?

Date formulas in Business Central are shorthand tools that help you calculate and manipulate dates. They’re not just for techies – anyone can use them to filter lists, define payment terms, or control report parameters. Once you learn the rules, you’ll wonder how you ever lived without them!


Common Rules of Date Formulas

  1. Every Formula Starts from a Base Date
    • This could be today (system date), a posting date, or another field.
    • Pro Tip: If you don’t specify a base date, Business Central often assumes it’s today.
    • Formulas are processed left to right and do not follow arithmatic rules, for example CM+10D is not the same at 10D+CM
  2. Work Date vs. System Date
    • The work date is a customizable date that users can set for their session. It can be used by calling out the variable WD instead of using ‘today’
    • Some formulas do not play well with WD so I usually spell it out as workdate if I get an error.
    • To set the work date: Go to Settings (Gear in Top Right) > My Settings > Work Date and update it as needed.
    • Pro Tip: If you don’t set a work date, Business Central defaults to the system date.
    • PRO PRO Tip: Using P (Or Period) uses Work Date by default.
  3. C Means Current
    • The letter “C” always points to the current period, but here’s the kicker: it means the last day of that period.
      • CM = Last day of the Current Month.
      • CY = Last day of the Current Year.
      • CW = Last day of the Current Week.
  4. Operators Move Time Forward or Back
    • Use + to move forward and to move backward.
      • Example: CM+10D means 10 days after the last day of the current month.
      • Example: CW-2D means 2 days before the last day of the current week.
  5. Time Units Are Simple (Sort of)
    • D = Days OR Day of the Month (See Item #6 below)
      • Don’t Spell it out – the rules are wonky and it’s just easier to NOT spell this out
    • W = Weeks OR Week of the Year OR Work Date – See Additional details of W Function
      • Week is Monday through Sunday and that is also the day count (Monday = 1st Day, so W+2D
  6. M = Months (You can also spell out “Month” but you cannot use M alone or the system will think you mean Monday)
    • Y = Years (You can also spell out “Year”)
    • Q = Quarters (You can also spell out “Quarter”)
    • P = Period (You can also spell out “Period”)
      • Example: If you always want a list to show current month, save it’s filter to just say ‘month’
  7. Placing “D” Before or After Numbers
    • Putting “D” after a number specifies the exact number of days.
      • Example: Today+10D = 10 days from today.
    • Putting “D” before a number defines the next occurrence of that number DAY of the Month.
      • Example: If today is 01/15/2024, today+D1 = Next occurrence of the 1st = 2/1/2025.  If we use today+D18, it will not be February 18th, because the next 18th is January 18th.  Got it?
  8. Placing “W” Before or After Numbers (See “W Function Explained”)
    • Putting “W” after a number specifies the exact number of weeks.
      • Example: Today+1W = 1 week from today.
    • Putting “W” before a number defines the next occurrence of that Week Number (for the year).
      • Example: If our base date is 01/15/2024, today+W1 = Next occurrence of Week #1 is 12/29/2025 (remember, weeks start on Mondays).  If our base date is 12/01/2024 and we use Workdate+W1 we would get the next Week 1 after 12/02/2024 which is 12/30/2024. It’s tough, I know.
  9. Ranges Are Written with ..
    • Use two periods (..) to define a range.
      • Example: TODAY..CM = From today through the last day of the current month.
      • Example: CM..CY = From the last day of the current month through the last day of the current year.
  10. Complex Chains Are Allowed
    • Combine elements for more precise results.
      • Example: CM+1M-3D = 3 days before the last day of the next month.
      • Example: CQ+1Q+15D = 15 days after the last day of the next quarter.
  11. P or Period Works Just A Bit Differently
    • Using the formula P or Period uses the Work Date by default and NOT the system date like other formulas. When using P1 or P2 type of Formulas, they are referring back to the periods setup in the Account Period window in the system.

Common Variables and What They Mean

Here’s your cheat sheet for the most popular variables:

VariableMeaningExample
TodayTodayToday+10D (10 days from today)
CWLast day of the current weekCW-3D (3 days before week-end)
CMLast day of the current monthCM+5D (5 days after month-end)
CQLast day of the current quarterCQ-7D (7 days before quarter-end)
CYLast day of the current yearCY+1M (1 month after year-end)

Real-Life Use Cases

  1. Filter Sales Orders Due This Month
    • Formula: TODAY..CM
    • Meaning: All orders due from today through the last day of this month.
  2. Set Payment Terms to Month-End + 15 Days
    • Formula: CM+15D
    • Meaning: Payment is due 15 days after the last day of the month.
  3. Find Late Payments
    • Formula: ..Today-1D
    • Meaning: All invoices due before today.
  4. Plan for the Next Quarter
    • Formula: CQ+1Q
    • Meaning: Last day of the next quarter.
  5. Show List of Current Period Transactions
    • Formula: Period
    • Meaning: Will automatically adjust o the current period based on Work Date (Period uses Work date, not system date, by default)

Make It Fun

Think of date formulas like a time machine. With a little practice, you can jump to any day, week, month, or year without ever leaving your chair.

Still feel like you need a flux capacitor? Don’t worry – the best way to learn is by experimenting. Open a filter pane, enter a formula, and see the magic happen. You’ll be bending time like a pro in no time!


Final Tip: Bookmark This Guide

If you’re new to date formulas, save this guide for quick reference. And remember, the more you use them, the faster you’ll get.

Now, go give it a shot and save yourself a ton of time… one date formula at a time!

Here is some additional examples and use cases… try them.  Did they work?  Comment below?  Need one that you don’t see?  Comment below!  Love to hear from you!

OPERATORS EXPLAINED



ID FUNCTION NOTES
OP01 .. Used as a start and stop "Range" in Date Formulas. Does not require values to be called out on both sides. If left out on the left, it will mean "beginning of time" and if left out on the right, it would mean "end of time"
OP02 - Subtracts a specified time period from a date
OP03 + Adds a specified time period to a date
OP04 < Less Than, or Before
OP05 > Greater Than, or After
OP06 = Equals, can be used with < and/or >
OP07 Operators are not read in order of operations mindset, they are read and processed left to right

FUNCTIONS EXPLAINED



T Function Explained

ID FUNCTION NOTES
T01 T if Used alone, you can use T and it will return today's system date
T02 TODAY TODAY can be used alone or in formulas, I actually prefer using TODAY rather than T

W Function Explained

ID FUNCTION NOTES
W01 W if Used alone, you can use W and it will return Work Date (Crazy, I know)
W02 Generally Don't like using W in a formula as a stand alone
W03 #W A number before W means number of weeks. CM+1W = Last Day of the Month plus one week
W04 W# A number AFTER W tells the system to call the 'Next Week Number X" based on the date being referenced. So if I do today +W1 means the first day of the next occurrence of a Week #1 in our calendar. So if this is 1/15/2025, it would return 12/29/2025

WD Function Explained

ID FUNCTION NOTES
WD01 WorkDate if Used alone, you can use WD. If you start to build a formula around it, the system thinks it's WeekDays
WD02 WD Lowercase will not work. Must be upper case. If no number is BEFORE or AFTER AND STAND ALONE (Not part of a formula), it will behave as Work Date. If you put a # BEFORE or AFTER WD, it does not mean work date, see below
WD03 #WD This Number Day of the Current Month based on base date
WD04 WD# Week Day (Monday = 1, Tuesday =2, etc) or System Date

D Function Explained

ID FUNCTION NOTES
D01 D if Used alone, you can use D and it will return Work Date (Crazy, I know)
D02 #D A number before D means number of days. CM+1D = Last Day of the Month plus one Day
D03 D# A number AFTER D tells the system to call the 'Next Day Number X" based on the date being referenced. So if I do today today+D3 means the next day "3" (or 3rd) based on the base date. So if 'today' is 01/15/2025, it would return 02/03/2025

Y Function Explained

ID FUNCTION NOTES
Y01 Y if Used alone, you can use Y and it will return a range for the current year, based on Work Date
Y02 YEAR if used alone, you can use "YEAR" and it will return a range for the current year, based on Work Date
Y03 #Y or #YEAR Unknown - please let me know if you know how to define this
Y04 Y100 Notice that this is actually Y100 not a variable. This will insert a date range from the beginning of the current month based on system date and through the end of time 01/01/XXXX..12/31/9999
Y05 Y# This moves the year ahead this man years from the year 2100 and only works up to 99. Why, I am not sure. I don't see any use for this right now. Do you use it? Do you have a better way of defining this, please let me know.

Date Formulas in Business Central

This document showcases a comprehensive list of date formulas in Microsoft Dynamics 365 Business Central. These formulas can be used for filtering, calculations, and workflows to make your processes more efficient.

Functions Explained (Examples below this table)

Description Variables/Functions Meaning
Current System Date Today Today’s date (system date) ** Don't use "T" - see below 
Current Work Date Workdate or WD Today's Work Date (Set under User Preferences, can replace "Today" in examples below
D# Next Occurance of Date, when "D" is suffixed by a number
#D Count of Days, when "D" is prefixed by a #
C Current
M (or Month) Current Month (Based on System Date)
Y (or Year) Current Year (Based on System Date)
Q (or Quarter) Current Quarter (Based on System Date)
P (or Period) Current Period (Based on WORK Date)
C + Variable (not spelled out) CM/CW/CY/CQ (End of Period)
-C + Variable (not spelled out) CM/CW/CY/CQ (Beginning of Period)
WD# Weekday (Monday = 1)
Minus
+ Addition
.. Range
< "Less Than" or "Before" since we are talking dates
> "Greater Than" or "After" since we are talking dates
blank System Date
Calendar Gregorian
Monday = Start of Week
Mo/Tu/We/Th/Fr/Sa/Su Respective Days of the Week
Formulas are Calculated/Processed from Left to Right
** Using "T" can confuse the system and/or the user as it can also be used for Time and Tuesdays

SHAWN’S RUNNING LIST OF EXAMPLES



ID Use Case Formula Meaning Common Application
EX001 Yesterday Today-1D Yesterday’s date Filter transactions created the day before
EX002 Tomorrow Today+1D Tomorrow’s date Plan for transactions or tasks due tomorrow
EX003 Last 7 Days Today-7D..Today The past 7 days, including today Analyze sales or invoices from the last week
EX004 Next 7 Days Today..Today+7D Today through the next 7 days Check tasks or deliveries due in the next week
EX005 Start of Current Week CW Last Day of Current Week (M-S) Filter data starting from the end of current week
EX006 Current Week Range CW-1W..Today From the start of the current week through today Analyze performance or orders for the week so far
EX007 This week CW-7D..CW The week leading up to the last day of the current week. Analyze last week’s performance
EX008 Last Week CW-2W..CW-2W+6D The entire last week (Monday to Sunday) Review transactions or progress from the previous week
EX009 Start of Current Month CM The last day of the current month Filter month-to-date data
EX010 Current Month Range CM-1M+1D..Today From the start of the month through today Track month-to-date sales or expenses
EX011 Last Month CM-2M+1D..CM-1M The entire last month Analyze last month’s performance
EX012 This Month CM-1M+1D..CM This entire month Filters
EX013 Next Month CM+1D..CM+1M The entire next month Plan for upcoming events or orders
EX014 Last 30 Days Today-30D..Today The past 30 days, including today Monitor recent trends in sales or invoices
EX015 Next 30 Days Today..Today+30D Today through the next 30 days Plan for deliveries or schedules for the next month
EX016 End of Current Year CY The last day of the current year Filter year-to-date transactions or data
EX017 Start of Current Year CY-1Y+1D The first day of the current year Filtering
EX018 Current Year Range CY-1Y+1D..Today From the start of the year through today Review annual progress
EX019 Last Year CY-2Y+1D..CY-1Y The entire last year Compare last year’s performance
EX020 Next Year CY+1D..CY+1Y The entire next year Forecast next year’s activities or budgets
EX021 1 Week Ago Today-1W The same day last week Review weekly trends
EX022 1 Month Ago Today-1M The same day last month Compare monthly performance
EX023 Year-to-Date CY-1Y+1D..Today From the beginning of the year to today Monitor progress toward yearly goals
EX024 End of Current Quarter CQ The Last day of the current quarter Filtering
EX025 Quarter-to-Date CQ-1Q+1D..Today From the start of the current quarter through today Analyze quarterly results
EX026 Specific Day in Current Month CM-1M+D15 The 15th day of the current month Plan or filter for mid-month transactions
EX027 Weekday in Current Week CW-1w+3d The Wednesday of the current week (3rd weekday) Plan activities on specific weekdays
EX028 Rolling 90 Days Today-90D..Today The past 90 days Review longer-term performance
EX029 Future Tasks or Orders Today..Today+14D Today through the next 14 days Plan tasks or deliveries in the near term
EX030 Recurring Monthly Invoices CM+15D The 15th day of the next month Automate recurring journal entries or invoice postings
EX031 Overdue Items ..Today-1D Any date before today Identify overdue payments or tasks
EX032 Seasonal Date Range Today..CM+3M Today through 3 months from the start of the current month Plan for a seasonal campaign
EX033 Custom Grace Period Today+7D Today plus 7 days Allow a 7-day grace period for payments
EX034 Two days before Month End CM-2D 2 Days before Month End  Mail Lead time
EX035 Last Day of the Current Month CM Last day of the current month Prepare month-end reports or close financial periods
EX036 Two Days Before Month-End CM-2D Two days before the last day of the current month Send reminders for month-end tasks
EX037 Range: Start of Month to Month-End CM-1M+1D..CM From the first day to the last day of the current month Filter transactions for the entire current month
EX038 Last Day of the Current Week CW Last day of the current week (Sunday) Prepare weekly status updates
EX039 One Day After the Current Week CW+1D First day of the next week Schedule tasks for the start of the next week
EX040 End of Last Week CW-1W Last day of the previous week Review last week’s activities or reports
EX041 Last Day of the Current Year CY Last day of the current year Finalize annual budgets or prepare year-end reports
EX042 End of Next Year CY+1Y Last day of the next year Plan for next year’s financial closing
EX043 Last Day of the Current Quarter CQ Last day of the current quarter Close the books for the current quarter
EX044 End of the Next Quarter CQ+1Q Last day of the next quarter Plan activities for the next quarter
EX045 5 Days Before the Current Quarter-End CQ-5D Five days before the last day of the current quarter Prepare for quarter-end tasks
EX046 Rolling 30 Days from Today Today-30D..Today The past 30 days, ending today Review recent trends
EX047 Rolling 7 Days from Week-End CW-7D..CW The week leading up to the last day of the current week Analyze last week’s performance
EX048 Current Week Range CW-6D..CW From the first to the last day of the current week Review all weekly activities
EX049 Year-to-Date (YTD) CY-1Y+1D..CY From the first day of the year to the last day of the year Filter all transactions for the current year
EX050 Month-to-Date (MTD) CM-1M+1D..Today From the first day of the current month to today Track monthly progress
EX051 Quarter-to-Date (QTD) CQ-1Q+1D..Today From the first day of the current quarter to today Evaluate quarterly performance
EX052 Two Months Before Month-End CM-2M Last day of the month two months ago Analyze data from two months prior
EX053 Current Week through Next Week CW-6D..CW+7D From the first day of this week to the last day of next week Plan tasks for the next two weeks
EX054 End of Previous Year CY-1Y Last day of the previous year Compare annual data
EX055 End of the Current Fiscal Period CY Last day of the fiscal year (if fiscal year matches calendar year) Finalize tax preparation
EX056 Delivery Deadline (10 Days Before Month-End) CM-10D Ten days before the last day of the month Set cutoff dates for deliveries
EX057 Schedule Next Week’s Work CW+1D..CW+1W Range for the next week Assign tasks for the coming week
EX058 Filter for Last 60 Days Today-60D..Today The past 60 days ending today Analyze mid-term trends
EX059 Rolling Quarter CQ-1Q..CQ The last quarter through the current quarter Evaluate performance for the last six months
EX060 Grace Period for Month-End CM+5D Five days after the last day of the month Allow a grace period for late submissions
EX061 End of Next Fiscal Quarter CQ+1Q Last day of the next fiscal quarter Prepare forecasts for the next quarter
EX062 Past Year (Rolling 365 Days) Today-365D..Today The past 365 days from today Analyze annual trends
EX063 End of Current Decade CY+5Y Last day of the decade (assuming 10-year spans) Evaluate decade-level goals
EX064 End of Previous Month CM-1M Last day of the previous month Analyze last month’s closing
EX065 Payment Due at Month-End CM Payment due on the last day of the current month. Common for monthly billing cycles.
EX066 Payment Due 15 Days After Month-End CM+15D Payment due 15 days after the last day of the current month. Used for providing customers a grace period after month-end.
EX067 Payment Due on the 1st of Next Month CM+1D Payment due on the first day of the next month. Quick turnaround payments starting the next billing cycle.
EX068 Payment Due at Quarter-End CQ Payment due on the last day of the current quarter. Common for quarterly financial settlements.
EX069 Payment Due 30 Days After Quarter-End CQ+30D Payment due 30 days after the last day of the current quarter. Provides extended time for quarterly payments.
EX070 Payment Due at Year-End CY Payment due on the last day of the current year. Annual billing or settlements.
EX071 Payment Due 60 Days After Year-End CY+60D Payment due 60 days after the last day of the current year. Provides additional time for year-end payments.
EX072 Payment Due 10 Days Before Month-End CM-10D Payment due 10 days before the last day of the current month. Ensures payments are processed before month-end deadlines.
EX073 Payment Due 45 Days from Invoice Date Today+45D Payment due 45 days from today. Standard for 45-day payment terms.
EX074 Payment Due Next Month’s End CM+1M Payment due on the last day of the next month. Gives clients time until the next month’s close.
EX075 Payment Due 7 Days After Invoice Date Today+7D Payment due 7 days from today. Short-term payment terms, typically for smaller invoices.
EX076 Payment Due at Next Quarter-End CQ+1Q Payment due on the last day of the next quarter. Plans payments for the following quarter.
EX077 Payment Due at the End of the Current Week CW Payment due on the last day of the current week. Weekly payment terms for fast transactions.
EX078 Payment Due Next Week’s End CW+1W Payment due on the last day of the next week. Short-term weekly payment extension.
EX079 Payment Due 2 Months Before Year-End CY-2M Payment due on the last day of the month, 2 months before the year-end. Collects payments well before the annual closing period.
EX080 Payment Due on the Next Friday CW+5D Payment due on the Friday of the current or next week, depending on today’s date. Flexible term aligned with weekly processing.
EX081 Payment Due 3 Days After Invoice Date Today+3D Payment due 3 days from today. Ultra-short payment terms for immediate transactions.
EX082 Payment Due 90 Days After Invoice Date Today+90D Payment due 90 days from today. Extended terms for large or strategic invoices.
EX083 Payment Due on the 15th of Next Month CM+1M+15D Payment due on the 15th day of the next month. Structured mid-month billing in the next cycle.
EX084 Payment Due 1 Week Before Month-End CM-7D Payment due 7 days before the last day of the current month. Ensures early payment processing before month-end.
EX085 Payment Due on the Last Friday of Month CM+1D-WD5 Payment due on the last Friday of the current month  Aligns billing with specific weekdays.
EX086 Payment Due at the Start of Next Quarter CQ+1Q-2M+1D Payment due on the first day of the next quarter. Prepares for the next quarter’s operations.
EX087 Payment Due 6 Months After Invoice Date Today+6M Payment due 6 months from today. Long-term agreements with extended payment cycles.
EX088 Payment Due 10 Days After Year-End CY+10D Payment due 10 days after the last day of the year. Allows processing delays at year-end.
EX089 Payment Due 14 Days Before Quarter-End CQ-14D Payment due 14 days before the last day of the current quarter. Ensures timely quarter-end settlements.
EX090 Payment Due Rolling 12 Months Today-12M..Today Payment due for all invoices from the last 12 months, including today. For reviewing and processing accumulated dues.
EX091 Payment Due Next Month’s Start CM+1M+1D Payment due on the first day of the next month. Smooth transition into the next month for payment cycles.
EX092 Payment Due Last Day of Fiscal Year CY Payment due on the fiscal year’s closing day (matching calendar year). Standard for annual financial reconciliations.
EX093 Payment Due 20 Days Before Year-End CY-20D Payment due 20 days before the last day of the year. Prepares payments ahead of annual close.
EX094 Payment Due on the Last Day of the Decade CY+10Y Payment due on the last day of the current decade (e.g., Dec 31, 2029). Special cases for long-term projects
EX095 Payment due at the end of the current month CM Last day of the current month.
EX096 Payment due 10 days after month-end CM+10D Adds 10 days to the last day of the month.
EX097 Quarterly tax payment due CQ Last day of the current quarter.
EX098 Annual financial closing CY Last day of the current year.
EX099 7 days before quarter-end CQ-7D 7 days before the last day of the current quarter.
EX100 Next fiscal year planning CY+1Y Last day of the next year.
EX101 Rolling 30-day review Today-30D..Today Data from the last 30 days, ending today.
EX102 Payment due 60 days after invoice Today+60D Due date is 60 days from the current date.
EX103 Delivery date set to the next month CM+1M Last day of the next month.
EX104 Order cutoff date CM-7D 7 days before the last day of the month.
EX105 Current week's sales report CW-6D..CW Data from the first day to the last day of the current week.
EX106 Future weekly delivery plan CW+1D..CW+7D Range for the next 7 days.
EX107 Late payment notification ..Today-1D Invoices due before today.
EX108 90-day lead time for purchase orders Today+90D Expected delivery in 90 days.
EX109 Inventory reorder cycle CM+14D Reorder 14 days after the last day of the current month.
EX110 Safety stock check at month-end CM Ensures sufficient stock for the last day of the current month.
EX111 Rolling quarterly inventory review CQ-1Q..CQ Data from the previous quarter through the current quarter.
EX112 Next quarter planning CQ+1Q Last day of the next quarter.
EX113 Inventory aging for the past year Today-365D..Today Review inventory turnover for the last 365 days.
EX114 Project milestone deadline CQ+1M 1 month after the current quarter’s end.
EX115 Start date for the next quarter CQ+1Q-2M+1D First day of the next quarter.
EX116 Rolling 12-month project performance review Today-12M..Today Data for the past 12 months.
EX117 End of production cycle CM-1D 1 day before the last day of the current month.
EX118 Start of the next production cycle CM+1M+1D First day of the next month.
EX119 Reminder 3 days before month-end CM-3D Sends a reminder 3 days before the current month ends.
EX120 Upcoming deadlines for the week Today..CW Deadlines through the last day of the current week.
EX121 Year-end employee reviews CY Last day of the current year.
EX122 Quarterly performance review deadline CQ-1D 1 day before the last day of the current quarter.
EX123 Monthly team meeting planning CM-10D Plan meetings 10 days before month-end.
EX124 Warranty expiration check Today+1Y Warranty expiration in 1 year.
EX125 Next fiscal period planning CY+1M 1 month after the last day of the current year.
EX126 Recurring Transactions Last Day of the Month 1D+1M-1D Uses Last Day of the Month when using Recurring Trx's (Original Date must be last day of the month)

Thanks for reading!

Shawn Dorward

Microsoft MVP, Business Applications

LifeHacks365.com | LinkedIn | Twitter

COMMENT BELOW



3 responses to “DATE FORMULAS in Business Central”

  1. Jeff Avatar
    Jeff

    Great article. Informative and interesting!

  2. Matthew Perren Avatar
    Matthew Perren

    Fantastic article Shawn. I’d change the image though. Not really selling the content is it? 😉

  3. Dan Karlsson Avatar
    Dan Karlsson

    There is one very practical formula that is missing.
    Y-1, period of last year. Very useful for reporting last years results. (y+1, y-2, p-1 and so on works also, if accounting periods have been created properly)
    Sadly I don’t know how the functionality works in detail, hoped to find that out from this article. 🙂

Leave a Reply

3 thoughts on “DATE FORMULAS in Business Central”

  1. Fantastic article Shawn. I’d change the image though. Not really selling the content is it? 😉

  2. There is one very practical formula that is missing.
    Y-1, period of last year. Very useful for reporting last years results. (y+1, y-2, p-1 and so on works also, if accounting periods have been created properly)
    Sadly I don’t know how the functionality works in detail, hoped to find that out from this article. 🙂

Leave a Reply