Date format

Horse06Horse06 Member Posts: 496
Hi expert, I need your help.
Hlow to dispaly the output as 2011-04-11

Below is the code:
EnterCell(Row, 72, FORMAT("Sales Invoice Header"."posting Date", 0,'<Year4>-<Month,2>-<Day,2>'),FALSE, FALSE, FALSE);
The output is 04/11/2011

Thank you!

Comments

  • ReinhardReinhard Member Posts: 249
    Hello,
    I believe that excel (or wherever you are "enteringCell") is formatting the date again, after the FORMAT function.
    To find out, try doing:
    MESSAGE(FORMAT("Sales Invoice Header"."posting Date", 0,'<Year4>-<Month,2>-<Day,2>'),FALSE, FALSE, FALSE));
    

    - Reinhard
  • Horse06Horse06 Member Posts: 496
    Thanky you! You are right, it is the Excel format. If I add the letter after it, everything should be fine.

    EnterCell(Row, 72, FORMAT("Sales Invoice Header"."Posting Date", 0, '<Year4>-<Month,2>-<Day,2>Z'),FALSE, FALSE, FALSE);
    But I do not any letter after it. How to present the correct format of yyyy-mm-dd? Appreciate it without manipulating the data? Appreciate it!
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV/Navision Classic Client' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • MGM08MGM08 Member Posts: 41
    Hi

    Fill the Numberformat field in excel buffer with "yyyy-mm-dd;@"
    for your date and try out.

    Hope this helps.
  • R_AR_A Member Posts: 3
    Hi!
    Also have problem with exporting to excel in "Native Date Format".
    The problem is that the report is going to use in different countries, with different Excel and local settings and Languages.

    I need to export Date in format already mentioned - "yyyy-mm-dd"
    Indeed the field in excel file became standard Excel Date, but in the Date in the field represents like: YYYY-01-25, but should be: 2012-01-25.
    If I setup Numberformat in Local format (in my occasion its rrrr-mm-dd) then i get the result which I expect, but i'm afraid that it will not work in other countries.

    Which value should I setup to the NumberFormat field in Excel Buffer table to get the right value in the Excel file.

    I was looking for the answer but didn't find, maybe somebody has a solution?

    Thanks in advance!
Sign In or Register to comment.