Options

How create a sum field in a repor and filter by six months

DarkHorseDarkHorse Member Posts: 389
Hello, I like to know how I can do the following. I need to show in a report the quantity of items sold in the last 6 months without filtering by date, I mean, get the system date and automatically count six months back. I know that I can create a sum field in "Sales Invoice Line", but I like do it in a report. How can I do that please?.
Thanks in advance.

Comments

  • Options
    BeliasBelias Member Posts: 2,998
    have you ever used CALCDATE function?Look in the help how to use it, apply it to TODAY or WORKDATE in order to create a filter like
    SETRANGE("Posting Date",CALCDATE(TODAY,'<-6M>'),TODAY)
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    DarkHorseDarkHorse Member Posts: 389
    Thanks for reply. I've used calcdate, but I didn't know how calculate 6 months ago. I' ll try what you say.
    Thanks you very much.
  • Options
    DarkHorseDarkHorse Member Posts: 389
    Sorry, it says me "Don't convert Date:=Text etc......" and stops on ,'<-6M>'. Do you know what can be the problem please?.
    Thanks.
  • Options
    BeliasBelias Member Posts: 2,998
    switch the paramaters in calcdate function!! #-o
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    DarkHorseDarkHorse Member Posts: 389
    Sorry; how exactly please?, I can't it work :oops:
  • Options
    BeliasBelias Member Posts: 2,998
    just an advice: it's easier and more useful for you to look at F1 help and find solution by yourself...

    btw, here is the solution: as i said, switch the parameters of calcdate function...
    "item ledger entry".setrange("posting date",calcdate('<-6M>',workdate),workdate);
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    DarkHorseDarkHorse Member Posts: 389
    Perfect!!! =D> It works perfectly. Thank you very much for your help and time.
Sign In or Register to comment.