filtering null values

vvillavvilla Member Posts: 3
Hello experts, I´ve a little problen here with some filters.

I need to apply a filter to some tables with dates and numbres as parameters, but what I've in that tables is a mix of "real" values and NULL (empties) ones. I want the filtered results to contain the NULL values too.

When I apply it to Text, I use the next code, and it works perfectly:

Rec.SETFILTER(Rec.name,'%1|%2',value,'');

But when the type of "Rec.name" is date, integer or decimal it doesn't work.

¿Any idea?

Thanks.

Comments

  • bbrownbbrown Member Posts: 3,268
    Why would you need this since NAV does not allow NULL values?

    A NULL is not the same as blank or zero.

    Rec.SETFILTER(Rec.name,'%1|%2',value, 0);
    Rec.SETFILTER(Rec.name,'%1|%2',value, 0D);
    Rec.SETFILTER(Rec.name,'%1|%2',value, 0T);
    There are no bugs - only undocumented features.
  • vvillavvilla Member Posts: 3
    Not even know that NULL don't exists. I've just arrived from C++.

    It works fine now.

    Sorry and thanks.
  • krikikriki Member, Moderator Posts: 9,110
    The NULL idea exists only for dates, times and datetimes.
    To use them, you need to use respectively 0D,0T,0DT in your code
    If you want to filter on them as a user (so WITHOUT code), you put '' into the filter.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.