applying filter on date

vyankuvyanku Member Posts: 791
hi

I want to put a condition in setfilter on fromdate & todate.
setfilter("posting date",'>%1..<=%2',fromdate,todate);

"Posting Date" has to be between (greater than fromdate & less than or equals to todate).
It got compiled but while running the report it is showing me an error "Filter condition '>=%1..<=%2' is invalid".
How can I apply the filter on posting date. :-k

Comments

  • MBergerMBerger Member Posts: 413
    use %1..%2 as your filter
  • vyankuvyanku Member Posts: 791
    IF I used use %1..%2 then it will become as good as setrange("Posting Date",fromdate,todate)
  • BeliasBelias Member Posts: 2,998
    at a first look at your post i was a bit disoriented, too...but after reading it carefully...

    setfilter("posting date",'>%1&<=%2',fromdate,todate);

    anyway...you wrote the solution by yourself 8)
    greater than fromdate & less than or equals to todate
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • SogSog Member Posts: 1,023
    edited 2009-04-15
    This comes straight from the help file in NAV
    This example shows how to use the SETRANGE function to specify that you only want to see customers 100 through 200.
    
    Customer.SETRANGE("No.", '100', '200');
    
    The above statement is a quick way to set the same filter as:
    
    Customer.SETFILTER("No.", '>=100&<=200'); 
    
    @ Below
    I stand corrected.
    But nevertheless the correct syntax for the setfilter was in the helpfile :)
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • BeliasBelias Member Posts: 2,998
    read carefully:
    '>%1&<=%2'
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.