{"id":29,"date":"2009-09-22T21:42:25","date_gmt":"2009-09-22T20:42:25","guid":{"rendered":"http:\/\/mibuso.com\/blogs\/alexchow\/2009\/09\/22\/how-to-calculate-the-current-fiscal-year\/"},"modified":"2009-09-22T21:42:25","modified_gmt":"2009-09-22T20:42:25","slug":"how-to-calculate-the-current-fiscal-year","status":"publish","type":"post","link":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/","title":{"rendered":"How to Calculate the Current Fiscal Year"},"content":{"rendered":"<p>In Navision, there&#8217;s no function that will give you the fiscal year according to what you&#8217;ve setup on the Accounting Period table. Here&#8217;s a code that will get the current fiscal year based on the accounting period:<\/p>\n<p>AccountingPeriod is a record variable \u00a0to table 50<br \/>\nDate1 and Date2 are date variables<\/p>\n<p>AccountingPeriod.RESET;<br \/>\nAccountingPeriod.SETRANGE(&#8220;New Fiscal Year&#8221;,TRUE);<br \/>\nAccountingPeriod.&#8221;Starting Date&#8221; := WORKDATE;<br \/>\nAccountingPeriod.FIND(&#8216;=&lt;&#8216;);<br \/>\nDate1 := AccountingPeriod.&#8221;Starting Date&#8221;;<br \/>\nIF AccountingPeriod.NEXT = 0 THEN<br \/>\n\u00a0 Date2 := 12319999D<br \/>\nELSE<br \/>\n\u00a0 Date2 := AccountingPeriod.&#8221;Starting Date&#8221; &#8211; 1;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Navision, there&#8217;s no function that will give you the fiscal year according to what you&#8217;ve setup on the Accounting Period table. Here&#8217;s a code that will get the current fiscal year based on the accounting period: AccountingPeriod is a record variable \u00a0to table 50 Date1 and Date2 are date variables AccountingPeriod.RESET; AccountingPeriod.SETRANGE(&#8220;New Fiscal Year&#8221;,TRUE);Read more<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8],"tags":[25],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-programming","tag-fiscal-year"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Calculate the Current Fiscal Year | Confessions of a Dynamics 365 Business Central Consultant<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Chow\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/\"},\"author\":{\"name\":\"Alex Chow\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#\\\/schema\\\/person\\\/3213720f9affa9b5be0511da90c51c0d\"},\"headline\":\"How to Calculate the Current Fiscal Year\",\"datePublished\":\"2009-09-22T20:42:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/\"},\"wordCount\":91,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#organization\"},\"keywords\":[\"fiscal year\"],\"articleSection\":[\"programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/\",\"url\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/\",\"name\":\"How to Calculate the Current Fiscal Year | Confessions of a Dynamics 365 Business Central Consultant\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#website\"},\"datePublished\":\"2009-09-22T20:42:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/how-to-calculate-the-current-fiscal-year\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"programming\",\"item\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/category\\\/programming\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Calculate the Current Fiscal Year\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#website\",\"url\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/\",\"name\":\"APC Dynamics | Dynamics 365 Business Central Consultant\",\"description\":\"Dynamics 365 Business Central experts. Less Talk. More Results.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#organization\",\"name\":\"APC Dynamics\",\"url\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/APCLogo216.png\",\"contentUrl\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/APCLogo216.png\",\"width\":216,\"height\":216,\"caption\":\"APC Dynamics\"},\"image\":{\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/APCommerceInc\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/ap-commerce-inc-\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCkM_LLmB4333D4Arjk0knyw\\\/about\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/#\\\/schema\\\/person\\\/3213720f9affa9b5be0511da90c51c0d\",\"name\":\"Alex Chow\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"Alex Chow\"},\"url\":\"https:\\\/\\\/www.apcdynamics.com\\\/articles\\\/author\\\/alex-chow\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Calculate the Current Fiscal Year | Confessions of a Dynamics 365 Business Central Consultant","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/","twitter_misc":{"Written by":"Alex Chow"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/#article","isPartOf":{"@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/"},"author":{"name":"Alex Chow","@id":"https:\/\/www.apcdynamics.com\/articles\/#\/schema\/person\/3213720f9affa9b5be0511da90c51c0d"},"headline":"How to Calculate the Current Fiscal Year","datePublished":"2009-09-22T20:42:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/"},"wordCount":91,"commentCount":0,"publisher":{"@id":"https:\/\/www.apcdynamics.com\/articles\/#organization"},"keywords":["fiscal year"],"articleSection":["programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/","url":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/","name":"How to Calculate the Current Fiscal Year | Confessions of a Dynamics 365 Business Central Consultant","isPartOf":{"@id":"https:\/\/www.apcdynamics.com\/articles\/#website"},"datePublished":"2009-09-22T20:42:25+00:00","breadcrumb":{"@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.apcdynamics.com\/articles\/how-to-calculate-the-current-fiscal-year\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.apcdynamics.com\/articles\/"},{"@type":"ListItem","position":2,"name":"programming","item":"https:\/\/www.apcdynamics.com\/articles\/category\/programming\/"},{"@type":"ListItem","position":3,"name":"How to Calculate the Current Fiscal Year"}]},{"@type":"WebSite","@id":"https:\/\/www.apcdynamics.com\/articles\/#website","url":"https:\/\/www.apcdynamics.com\/articles\/","name":"APC Dynamics | Dynamics 365 Business Central Consultant","description":"Dynamics 365 Business Central experts. Less Talk. More Results.","publisher":{"@id":"https:\/\/www.apcdynamics.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.apcdynamics.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.apcdynamics.com\/articles\/#organization","name":"APC Dynamics","url":"https:\/\/www.apcdynamics.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.apcdynamics.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/www.apcdynamics.com\/articles\/wp-content\/uploads\/2025\/05\/APCLogo216.png","contentUrl":"https:\/\/www.apcdynamics.com\/articles\/wp-content\/uploads\/2025\/05\/APCLogo216.png","width":216,"height":216,"caption":"APC Dynamics"},"image":{"@id":"https:\/\/www.apcdynamics.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/APCommerceInc\/","https:\/\/www.linkedin.com\/company\/ap-commerce-inc-\/","https:\/\/www.youtube.com\/channel\/UCkM_LLmB4333D4Arjk0knyw\/about"]},{"@type":"Person","@id":"https:\/\/www.apcdynamics.com\/articles\/#\/schema\/person\/3213720f9affa9b5be0511da90c51c0d","name":"Alex Chow","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Alex Chow"},"url":"https:\/\/www.apcdynamics.com\/articles\/author\/alex-chow\/"}]}},"_links":{"self":[{"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":0,"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apcdynamics.com\/articles\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}