Date Error

navimbsnavimbs Member Posts: 137
Not a valid date....."GLBudgetEntry.SETRANGE(Date,0D,12319999D);"

What is the correct format?

Comments

  • ara3nara3n Member Posts: 9,256
    change the code to this

    GLBudgetEntry.SETRANGE(Date);

    that way there is not filter.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,305
    12319999, that's December 31st of the year 9999, I don't think NAV's calendar goes quite that far. Try 2099 or something a little closer than 9999.

    Oh and if your goal is to remove the date filter, then follow Rashed's advice.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    navimbs wrote:
    Not a valid date....."GLBudgetEntry.SETRANGE(Date,0D,12319999D);"

    What is the correct format?

    Isn't it
    GLBudgetEntry.SETRANGE(Date,01010001D,12319999D);
    

    But really Ahmed's suggestion is the correct one.
    David Singleton
  • ayhan06ayhan06 Member Posts: 210
    the best one is
    GLBudgetEntry.SETRANGE(Date)
    

    but the correct one must be
    GLBudgetEntry.SETRANGE(Date,0D,31129999D);
    
  • navimbsnavimbs Member Posts: 137
    Hi Guys,

    Thanks a lot for your inputs....!!!

    I tried GLBudgetEntry.SETRANGE(Date,0D,31129999D);

    I think for NAV 4.0 SP3, the date format Month-Date-Year works.

    This works perfectly fine.

    Thanks a million to all u guys :D !!!!!!!
  • PeterDPeterD Member Posts: 66
    I tested in 2.60 and 3.60 and the format seems to correspond to the Windows country settings???

    If that's really true:
    :evil:
    ](*,)
    :sick:
  • krikikriki Member, Moderator Posts: 9,110
    So better always use my way:
    GLBudgetEntry.SETRANGE(Date,0D,DMY2DATE(31,12,9999));
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • todrotodro Member Posts: 117
    PeterD wrote:
    I tested in 2.60 and 3.60 and the format seems to correspond to the Windows country settings???

    If that's really true:
    :evil:
    ](*,)
    :sick:
    it's easy: 8)

    this is from the Navision help:
    Entering Dates
    How you enter dates depends on the settings that have been selected in the Regional Options window in the Windows Control Panel. You can enter dates with or without separators.
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • PeterDPeterD Member Posts: 66
    @Kriki
    I will use your way from now on.

    @Todro
    The help for this is for a user and not for a developer. The application designers guide:
    date constant A date constant is written as six or eight digits followed by
    the letter "D" (the date constant expressing "undefined date" is, however,
    entered as "0D"). The digits specify the date in the format MMDDYY or
    MMDDYYYY.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    PeterD wrote:
    @Kriki
    I will use your way from now on.

    No that's not the correct solution. The correct solution was the first reply:
    ara3n wrote:
    change the code to this

    GLBudgetEntry.SETRANGE(Date);

    that way there is not filter.
    David Singleton
  • todrotodro Member Posts: 117
    PeterD wrote:
    @Todro
    The help for this is for a user and not for a developer. The application designers guide:
    date constant A date constant is written as six or eight digits followed by
    the letter "D" (the date constant expressing "undefined date" is, however,
    entered as "0D"). The digits specify the date in the format MMDDYY or
    MMDDYYYY.
    well, try to use the wrong format in the editor and navision will redirect you to the online help :lol: You are right with the documentation but as this never (at least back to version 1.3) worked differently in the past versions, I consider the ADG being wrong.

    Everytime you work in a different regional settings environment, you will see that navision is changing the text constants. I treat this as expected behaviour :wink:
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    todro wrote:
    ...You are right with the documentation but as this never (at least back to version 1.3) worked differently in the past versions, I consider the ADG being wrong.

    Everytime you work in a different regional settings environment, you will see that navision is changing the text constants. I treat this as expected behaviour :wink:

    Well they ixed the CALCDATE forumual with a good solution. Personally I would like to see something like:

    <20070828D>

    as the constant in the editor.

    I remember back when I did my first Navision implementation in Hungary, and my first reaction was "Hey this country got the dates right".
    David Singleton
  • todrotodro Member Posts: 117
    todro wrote:
    ...You are right with the documentation but as this never (at least back to version 1.3) worked differently in the past versions, I consider the ADG being wrong.

    Everytime you work in a different regional settings environment, you will see that navision is changing the text constants. I treat this as expected behaviour :wink:

    Well they ixed the CALCDATE forumual with a good solution. Personally I would like to see something like:

    <20070828D>

    as the constant in the editor.

    I remember back when I did my first Navision implementation in Hungary, and my first reaction was "Hey this country got the dates right".
    I second this thought, this would be the right way. But as we all know: navision is not sold by development goodies :mrgreen:
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
Sign In or Register to comment.