NAV date field data with three characters month (31-Dec-14)

smmurugansmmurugan Member Posts: 33
Hi Friends,

Is it possible in NAV to enter data in date field as '11-Dec-14' format?

To avoid confusion among users about date format - 'dd-mm-yy' or 'mm-dd-yy' - is it possible in NAV enter date as 11-Dec-14?

I tried both in Classic as well RTC - not accepting.

Can anyone confirm this how NAV works?

Thanks

Murugan

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Date format in NAV depends on Windows Regional settings. Please change the Date Format in Regional settings of machine and try.
  • tinoruijstinoruijs Member Posts: 1,226
    I cannot confirm if you can't use months as text. Don't think you can.
    But you could use the calender in RTC of course.
    Or use day of the week plus weeknumber. Like m12 for mondag week 12.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • smmurugansmmurugan Member Posts: 33
    Dear Mohana,

    Thanks for the quick response.

    Yes. That was the first thing I did. Please see the screenshot attached.

    My Windows system date - 18-Dec-14

    NAV Status bar date - 18-12-13

    See the error below when I entered '11-Dec-14' in date field.

    Microsoft Dynamics NAV Classic
    '11-Dec-14' is not a valid date.

    OK
  • smmurugansmmurugan Member Posts: 33
    Hi Tino,

    I know these alternatives. But for the data entry users prefers to use this format to avoid any confusion.

    Murugan
  • keomakeoma Member Posts: 11
  • keomakeoma Member Posts: 11
    alternative:

    you'll need following code in function MakeDateText in codeunit 1 to convert your given date (e.g. 15-MAR-11) into a valid date value:

    MakeDateText(VAR DateText : Text[250]) : Integer
    // additional local variables
    // mPos | Integer
    // monthText | Text | 10
    // monthValue | Integer
    // Text Constant: Text022 | JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC

    Position := 1;
    Length := STRLEN(DateText);
    ReadCharacter(' ',DateText,Position,Length);

    // begin changes
    DateText := CONVERTSTR(DateText,'-',',');
    monthText := SELECTSTR(2,DateText);
    mPos := STRPOS(Text022,monthText);
    IF mPos > 0 THEN BEGIN
    monthValue := (mPos + 3) / 4;
    monthText := PADSTR('',2 - STRLEN(FORMAT(monthValue)),'0') + FORMAT(monthValue);
    DateText := SELECTSTR(1,DateText) + '-' + monthText + '-' + SELECTSTR(3,DateText);
    END ELSE
    DateText := CONVERTSTR(DateText,',','-');
    // end changes

    IF NOT FindText(PartOfText,DateText,Position,Length) THEN
    ...

    cheers
    regards
Sign In or Register to comment.