Export date where year has 4 digits

PEzechielsPEzechiels Member Posts: 83
edited 2006-12-21 in Navision Financials
Hi,

Does anyone know how to export a date field where the year consists of 4 digits?

thnx

Comments

  • ClausHamannClausHamann Member Posts: 80
    Hi

    Have you tried:

    FORMAT(TODAY,0,'<Day,2>-<Month,2>-<Year4>');
    which will return the date format DD-MM-YYYY.

    Regards

    Claus
  • jversusjjversusj Member Posts: 489
    Hi

    Have you tried:

    FORMAT(TODAY,0,'<Day,2>-<Month,2>-<Year4>');
    which will return the date format DD-MM-YYYY.

    Regards

    Claus
    Thanks Claus! i have been trying to do this but couldn't figure out the syntax based just on the help files. Now it all makes sense!
    kind of fell into this...
  • SavatageSavatage Member Posts: 7,142
    The C\Side Ref Guide has some good examples under
    Format not FORMAT


    Date: Day,Month,Month Text,Quarter,Year,Year4,Week, Week Year,Week Year4,Weekday,Weekday Text,Closing

    for Example

    <Closing><Month,2>/<Day,2>/<Year>
    0
    04/05/03

    <Closing><Month,2>/<Day,2>/<Year>
    1
    04/05/03

    <Month,2><Day,2><Year><Closing>D
    2
    040503D

    <Closing><Year>/<Month,2>/<Day,2>
    3
    03/04/05

    <Month Text> <Closing><Day>, <Year4>
    4
    April 5, 2003

    <Closing><Month,2><Day,2><Year>
    5
    040503

    <Closing><Year><Month,2><Day,2>
    6
    030504
  • jversusjjversusj Member Posts: 489
    Savatage wrote:
    The C\Side Ref Guide has some good examples under
    Format not FORMAT
    Harry,
    Thanks. I had looked at both Format and FORMAT. When reading about Format, it said it applied to textboxes and dataport fields. I am writing to a text file from a report, so I couldn't figure out what the syntax was supposed to be to call the Custom Format for a global variable in a processing report. I couldn't get anything I tried to make up to compile. what can i say? i'm far from being a developer (but getting a little closer each day, thanks to MIBUSO!).

    Claus' snippet of code made me realize that i was overthinking it. FORMAT(daterec,0,'<custom formula>'); makes sense, although i honestly do not know what the 0 parameter is. I included it in my use and got the results i want, but would love to know what it actually does for me.


    :)

    thanks!
    kind of fell into this...
  • DenSterDenSter Member Posts: 8,307
    The parameter is for length. Read the C/SIDE reference guide (under the Help menu) and search for FORMAT, it will be explained there. I know it does, because it is right there
    > to the right of my browser window.
  • SavatageSavatage Member Posts: 7,142
    edited 2006-12-21
    String := FORMAT(Value [, Length] [, FormatNumber | FormatString])

    Equals zero (0)
    The system will return the entire value (default)
    .
    .
    .

    I just think of it as it being the Standard Format that will appear
  • jversusjjversusj Member Posts: 489
    DenSter wrote:
    The parameter is for length. Read the C/SIDE reference guide (under the Help menu) and search for FORMAT, it will be explained there. I know it does, because it is right there
    > to the right of my browser window.
    :oops: Sure enough!

    I have not used this parameter when I used FORMAT in the past. I just used FORMAT(whatever);

    I learn one new thing today and relearn an old thing - this time, properly! Thanks again.
    kind of fell into this...
  • SavatageSavatage Member Posts: 7,142
    I Use it to give me unique doc numbers for a vendor credit dataport

    VenNo := "Account No.";
    MonthName := FORMAT(TODAY,0,'<Month Text,3><Year>');
    "Document No." := VenNo+'-'+MonthName;

    Result :
    ABC111-DEC06
    ABC222-DEC06
    ABC333-DEC06

    & yes we only do it once a month.
Sign In or Register to comment.