Setfilter in Date range

navuser1navuser1 Member Posts: 1,329
Hi All,

Please Share your knowledge...

I have Table A and it has a Field Date.

How to use SETFILTER function
if the Date Range is 18/10/08|20/10/08 OR 18/10/08..20/10/0/|29/10/08.
Now or Never

Comments

  • merrilmerril Member Posts: 38
    Try
    SETFILTER("Field in table",'%1..%2',FromDate,ToDate);
    
  • navuser1navuser1 Member Posts: 1,329
    merril wrote:
    Try
    SETFILTER("Field in table",'%1..%2',FromDate,ToDate);
    

    Suppose Table A is a dataitem of any report and Date is the ReqFilterFields of that report
    and any one set the date filter like 18/10/0/|21/10/08..29/10/08 then
    how does Setfilter works ??
    Now or Never
  • kinekine Member Posts: 12,562
    Do you mean what it will filter?

    It will filter everything with 18/10/08 or between 21/10/08..29/10/08 (including the limits).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • navuser1navuser1 Member Posts: 1,329
    kine wrote:
    Do you mean what it will filter?

    It will filter everything with 18/10/08 or between 21/10/08..29/10/08 (including the limits).


    No Kine, I mean how can I Filter this in my setfilter function if the
    Date field is ReqFilterFields ??
    Now or Never
  • navuser1navuser1 Member Posts: 1,329
    kine wrote:
    Do you mean what it will filter?

    It will filter everything with 18/10/08 or between 21/10/08..29/10/08 (including the limits).


    Thnx for your reply...

    Suppose Table A is a dataitem of any report and Date is the ReqFilterFields of that report
    and any one set the date filter like 18/10/0/|21/10/08..29/10/08 then
    how does Setfilter works ??
    Now or Never
  • kinekine Member Posts: 12,562
    You do not need anything more... dataitem will be filtered by entered filter expression...

    may be I still have problem with understanding your question, but what is your problem? Can you describe what and why you need to know?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • navuser1navuser1 Member Posts: 1,329
    kine wrote:
    You do not need anything more... dataitem will be filtered by entered filter expression...

    may be I still have problem with understanding your question, but what is your problem? Can you describe what and why you need to know?


    I'm waiting for your reply.
    Thank you for that.

    I have a table Name FinalView select the Date field on the ReqFilterFields of the report.

    The user can set filters on this field.

    Suppose user set filter like 18/10/08|20/10/08..29/10/08 on the Date field.

    Now I want to apply this filter into another table(Named ABC, it also has a date field);

    then what will be the SETFILTER Syntax ??

    ABC.SETFILTER(ABC.Date,??);
    Now or Never
  • kinekine Member Posts: 12,562
    Ok, the question is, "how to copy the filter from one field to another field in another table..."... 8)

    Look for COPYFILTER function... (e.g. in on-line C/AL help).. :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • navuser1navuser1 Member Posts: 1,329
    Thnx a lot kine.

    I have used the COPYFILTER Function for the same when unable to
    handle by the SETFILTER function.

    Thank you againg for your reply.
    Now or Never
Sign In or Register to comment.