Table filter strange problem

ASTAST Member Posts: 108
edited 2007-07-28 in SQL General
Hi,
Maybe someone had similar problem.
I have two identical tables:
- on local sql server (Table Filter works fine)
- on remote sql server (Table Filter doesn't work - omit some records)
I use the following combinations of filter:
Field1 (Boolean): Yes
Field2 (Boolean): No

I have the same properties of sql server, database and table and I use the same collation.
:?:

Answers

  • ASTAST Member Posts: 108
    Dou you have any suggestions why this prolem appear? :-k
  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from Navision forum to SQL General forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kinekine Member Posts: 12,562
    How did you tested that?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ASTAST Member Posts: 108
    I just created one table on local server and exported it to remote server. I have the same data in both of tables. I tested 2 fileds of boolean type. On local server Table Filter works good but on remote server doesnt't work even in sipmle case (doesn't show all records which satisfy the conditions).
    Example: I know that there are 8 records that meet conditions and I Navision show only 5.
  • kinekine Member Posts: 12,562
    Try to look at the records directly to SQL. Check if there are correct values 0/1 instead false/true...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ASTAST Member Posts: 108
    I solved my problem :D
    Becouse I didn't insert value to my table directly, but using outside application, I set sql property Allows Null to Yes (I didn't need import default values to this table). So I had NULL value insted of 0. Navision doesn't know NULL value?
  • ara3nara3n Member Posts: 9,256
    The trick I use for NULL is this.

    If I want to filter for true, I set the following filter

    setfilter(MYField,'<>%1',true);

    this will include false, as well as NULL.


    If I want to filter on false

    setfilter(MYField,'<>%1',false);

    This includes true as well as NULL.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,115
    And this might help for finding NULL, I suppose?
    SETFILTER("The Boolean",'<>%1&<>%2',TRUE,FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.