Handel the Date Format

Hello Folks ! I have following question: If i have two dates e.g. 12.01.99 and 20.3.99 and i want to get the Nummers of Day between those two date, how can i manage this ??? (in C/AL)

You can simple subtract them. days := date2 - date1; will work, or if you want/need to use those specific dates days := 200399D - 120199D; will also work. Dennis van Es PerCom: Research & Development BV The Netherlands

Thank you very much for your quick answer, right now i use following code: nr := ((DATE2DMY(DATE2,3) - DATE2DMY(DATE1,3))*12) + (DATE2DMY(DATE2,2) - DATE2DMY(DATE1,2))

Before you run the code which subtracts one date from the other, you should test to see if either is undefined (i.e., equal to 0d). Otherwise, the program will halt to remind you that ou can’t do arithemtic on undefined dates :slight_smile: Tim Horrigan tim.horrigan@emsolution.com ------- Tim Horrigan

Thank horrigan, I don t realise this problem until i read your post :slight_smile: ! Thanks, i have immediatly correct my C/AL Code !

Not to offend you, but the manual gives an example of this :slight_smile: Palle Arentoft, Team Manager Aston Naviteam A/S Denmark Email : par@astonitgroup.com