First date of the month

fmhigue
fmhigue Member Posts: 290
edited 2004-03-15 in Navision Attain
Is there a function that gives me the value of the first date of the month.

Because I need Quotes and Sales Orders to change USD to Pesos based on the first date of the current month.

Comments

  • craigbarbs
    craigbarbs Member Posts: 60
    NewDate := CALCDATE('-CM',PODate);
  • DenSter
    DenSter Member Posts: 8,307
    NewDate := CALCDATE('CM + 1D - 1M',MyDate);
    
    Where MyDate is the date that you pass. CM will give you the last day of the month, '+1D' will give the first day of the month after that, '-1M' will give you the first day of the month before that, i.e. the first day of the month for MyDate.

    HTH,
    Daniel.
  • DenSter
    DenSter Member Posts: 8,307
    Wow you never stop learning :) '-CM' is much easier :)
  • fmhigue
    fmhigue Member Posts: 290
    I have been using Navision for Mexico offices since 1999 but I was considered a Expert User only, now I have permission to made changes to Code.

    I appreciate your help
    This website it is just great!
    :P