Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Programming Microsoft Dynamics 365 Business Central - Sixth Edition

You're reading from  Programming Microsoft Dynamics 365 Business Central - Sixth Edition

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789137798
Pages 536 pages
Edition 6th Edition
Languages
Authors (3):
Marije Brummel Marije Brummel
Profile icon Marije Brummel
David Studebaker David Studebaker
Profile icon David Studebaker
Christopher D. Studebaker Christopher D. Studebaker
Profile icon Christopher D. Studebaker
View More author details

Table of Contents (12) Chapters

Preface Introduction to Business Central Tables Data Types and Fields Pages - The Interactive Interface Queries and Reports Introduction to AL Intermediate AL Advanced AL Development Tools Successful Conclusions Assessments Other Books You May Enjoy

DMY2DATE and DWY2DATE functions

DMY2DATE allows us to create a date from integer values (or defaults) representing the day of the month, month of the year, and the four-digit year. If an optional parameter (MonthValue or YearValue) is not specified, the corresponding value from the system date is used. The syntax is as follows:

DateVariable := DMY2DATE ( DayValue [, MonthValue] [, YearValue] ) 

The only way to have the function use work date values for month and year is to extract those values and then use them explicitly. An example is as follows:

DateVariable := DMY2DATE(22,DATE2MDY(WORKDATE,2),DATE2MDY(WORKDATE,3)) 
This example also illustrates how expressions can be built up of nested expressions and functions. We have WORKDATE within DATE2MDY within DMY2DATE.

DWY2DATE operates similarly to DMY2DATE, allowing us to create a date from integer values representing the day of the week (from 1 to 7 representing Monday to Sunday), week of the year (from 1 to 53), followed by the four-digit...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}