Date

Hi
I'm a developer in NAV 2009 classic. I wonder how I will do if I had a date that says 2018-01-01.
Can I change it to 01-01-2018 and still have a Datefield?

Best Answer

  • sorenhinrupsorenhinrup Posts: 109
    Accepted Answer
    I would split up the date imported and the construct my own date variable to validate into the system.
    Year := copystr([ImportedDate],1,4)
    Month := copystr([ImportedDate],6,2)
    Day := copystr([ImportedDate],8,2)

    And then Date := DMY2DATE(Day [, Month] [, Year])
    I think a workaround like this should work.

Answers

  • Wisa123Wisa123 Posts: 265Member
    Can I change it to 01-01-2018 and still have a Datefield?
    Why don't you try it? :)

    But honestly, in 2009 Classic and onwards the Client decides which date format is used for presentation purposes. So it's important that the machine running the client has the Language/Region settings configured correctly.

    /Wisa
    Austrian NAV/BC Dev
  • AnitaOAnitaO SwedenPosts: 9Member
    Klienten er rigtig, det er dato som komer fra en file og ska læses ind i NAV.
  • sorenhinrupsorenhinrup Posts: 109Member
    Accepted Answer
    I would split up the date imported and the construct my own date variable to validate into the system.
    Year := copystr([ImportedDate],1,4)
    Month := copystr([ImportedDate],6,2)
    Day := copystr([ImportedDate],8,2)

    And then Date := DMY2DATE(Day [, Month] [, Year])
    I think a workaround like this should work.
Sign In or Register to comment.