如何筛选microsoft dynamics nav中的2条记录

时间:2015-05-11 20:09:35

标签: microsoft-dynamics

我想在microsoft dynamics nav中的记录的2个字段上设置过滤器。

这是我尝试的但是它不起作用:

//set filter on the fields "Location Start" that are not blanco.
myRecord.SETFILTER("Location Start",'<>%1','');
myRecord.SETFILTER("Location End",'<>%1','');

我需要在&#34;位置开始&#34;上设置过滤器。以及&#34;位置结束&#34;

4 个答案:

答案 0 :(得分:1)

WITH Customer DO BEGIN
  FILTERGROUP(-1);
  SearchString := '@*ou*';
  SETFILTER(Name, SearchString);
  SETFILTER(Contact, SearchString);
  SETFILTER(City, SearchString);
  IF FINDSET THEN
    REPEAT
     MARK(TRUE);
    UNTIL NEXT = 0;
  FILTERGROUP(0);
  MARKEDONLY(TRUE);
  PAGE.RUN(0,Customer)
END

答案 1 :(得分:0)

这就像你写的一样。 你选错了记录? 如果您在某个网页上,请直接使用SETFILTER("Location Start", '<>%1', '');,而不是使用Rec.SETFILTER ... 您能否提供一些不起作用的内容或您正在尝试做的事情?

答案 2 :(得分:0)

myRecord.SETFILTER("Location Start",'<>%1',0D);
myRecord.SETFILTER("Location End",'<>%1',0D);

0D是设置空日期的方式

答案 3 :(得分:0)

如果您需要查明您的日期是否在开始日期和结束日期之间,那么您需要写如下,...

myRecord.SETFILTER("Location Start", '>%1', you_date);
myRecord.SETFILTER("Location End", '<%1', you_date);
If myRecord.ISEMPTY then FALSE
  ELSE TRUE