Options

calculate last years date..based on user entered date

nbangazanbangaza Member Posts: 30
Hi All ,

On a report, when a user enters a start date e.g. 25/03/10 and an end date 30/06/10 i want to be able to return the previous year's orders for them. e.g. (last year start date)25/03/09 and (last year end date) 30/06/09.

how do i go about finding the preivous year's date?

Comments

  • Options
    hemantOnehemantOne Member Posts: 98
    hi,

    I think CalcDate function may be helpful to you.
    Regards,
    Hemant
    They can conquer who believe they can
    .
  • Options
    nbangazanbangaza Member Posts: 30
    i tried using calcdate..but the syntax i used caused compiling errors..i dont know what syntax to use
  • Options
    hemantOnehemantOne Member Posts: 98
    Use
    lastdate:=('-1Y',startdate)
    Regards,
    Hemant
    They can conquer who believe they can
    .
  • Options
    DenSterDenSter Member Posts: 8,304
    Click on the Help menu, and select "C/SIDE Reference Guide". This will give you access to all the syntax explanations you will ever need.

    Another way to get the right help is to open the C/AL editor, open the C/AL Symbol Menu (press F5), browse down to SYSTEM on the left side, then to 'Date' in the middle, then CALCDATE on the right, and then hit F1.
  • Options
    KYDutchieKYDutchie Member Posts: 345
    Please Try
    CalcDate('<-1Y>',startDate);

    If you use the '<' and '>' the Calcdate will use the English date calculation.
    Otherwise it will use the local translated to the client language Calcdate abbreviations.
    Like '<1Y>' in English will translate into '1J' in Dutch.

    Hope this helps,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    DenSter wrote:
    Click on the Help menu, and select "C/SIDE Reference Guide". This will give you access to all the syntax explanations you will ever need.

    Another way to get the right help is to open the C/AL editor, open the C/AL Symbol Menu (press F5), browse down to SYSTEM on the left side, then to 'Date' in the middle, then CALCDATE on the right, and then hit F1.


    Teach a man to fish. :thumbsup:
    David Singleton
  • Options
    DenSterDenSter Member Posts: 8,304
    Teach a man to fish. :thumbsup:
    Damn straight, too bad most people these days only seem to want deep fried fish nuggets, handed to them, on a plate, with sauce on the side, a fork and a napkin :mrgreen:
Sign In or Register to comment.