# DATE2DWY Problem

Is it me? Variables v through z type Integer

``````v := DATE2DWY(123198D,3);
w := DATE2DWY(123199D,3);
x := DATE2DWY(123100D,3);
y := DATE2DWY(123101D,3);
z := DATE2DWY(123102D,3);
MESSAGE('%1\'+
'%2\'+
'%3\'+
'%4\'+
'%5',v,w,x,y,z);
``````

The message gives 1998,1999,2000,2002,2003.

``````v := DATE2DWY(123198D,3);
w := DATE2DWY(123199D,3);
x := DATE2DWY(123100D,3);
y := DATE2DWY(123001D,3);
z := DATE2DWY(123002D,3);
MESSAGE('%1\'+
'%2\'+
'%3\'+
'%4\'+
'%5',v,w,x,y,z);
``````

The message gives 1998,1999,2000,2001,2003.

``````v := DATE2DWY(123198D,3);
w := DATE2DWY(123199D,3);
x := DATE2DWY(123100D,3);
y := DATE2DWY(123001D,3);
z := DATE2DWY(122902D,3);
MESSAGE('%1\'+
'%2\'+
'%3\'+
'%4\'+
'%5',v,w,x,y,z);
``````

The message gives 1998,1999,2000,2001,2002. Or is it a bug? Rick Acton High-Tech Consulting Services 301-662-0732

Which version of Navision are you using as GB3.01b works as expected. From Help Comments If the input date to the DATE2DWY function is in a week which spans two years, the DATE2DWY function computes the output year as the year of the first day in the week. This situation is shown in the example below. Paul Baxter

Ahhhhhhhhhhhhâ€¦ The light clicks on. Thanks. Rick Acton High-Tech Consulting Services 301-662-0732 Edited by - goofyfish on 2002 Jan 17 16:53:32

But Rick This is not what you were saying was happening, or is this what you were expecting to happen. Paul Baxter

Hi Paul - We were using DATE2DWY on the date 12/31/01, which IS the 1st day of the first week of 2002. Hence the answers. Using DATE2DMY resolves the problem. Rick Acton High-Tech Consulting Services 301-662-0732 Edited by - goofyfish on 2002 Jan 17 17:15:29