SETFILTER in SQL Database different with Native Database?

intelcore2quad88intelcore2quad88 Member Posts: 7
Hello everyone,

I have the issues below: When i release my report to Customer, they say that number in report is wrong, but when I backup database and restore to my laptop, I have the right number! After that, I know my customer run NAV with Native Database, I run with SQL Database, and I have the problem with SETFILTER command:
GLEntry.SETFILTER("G/L Account No.",'<>131*');

- In Native Database, it return Data with G/L Account No: 13199
NativeDatabase.jpg

- In SQL Database, it does not return Data with G/L Account No: 13199
SQLDatabase.jpg

So, this is reason why Customer run report which return wrong number, but I run report return right number #-o

Has everyone had the problem yet?

Thanks.

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    I have the issues below: When i release my report to Customer, they say that number in report is wrong, but when I backup database and restore to my laptop, I have the right number! After that, I know my customer run NAV with Native Database, I run with SQL Database, and I have the problem with SETFILTER command:

    WRONG. Your issue is that you are developing in a different environment to that which your customer is using.

    You must use the same versions for development and testing and live.

    This is just one of many things that are different between the two databases.
    David Singleton
  • ssinglassingla Member Posts: 2,973
    As David suggested there is difference between the sorting of "Code" field in Native and SQL db.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • intelcore2quad88intelcore2quad88 Member Posts: 7
    After I have tried some expression filter, I decide not to use : <>A*, because no expressions return right value in Native Database!
    So I decide to choose another way.
    This is my way:
    Before
    1. GLE.SETFILTER("G/L Account No.",'<>A*&<>B*');
    2. GLE.SETFILTER("G/L Account No.",'%1&%2','<>A*','<>B*');
    2. GLE.SETFILTER("G/L Account No.",'<>%1&<>%2','A*','B*');
    => all are fail
    After
    Create new variable GLE2
    1. GLE2.SETFILTER("G/L Account No.",'A*|B*'); //Get entry contain "G/L Account No." = A* or B*
    2. IF GLE.FINDSET THEN REPEAT
           IF NOT GLE2.GET(GLE."Entry No.") THEN BEGIN
           ...........//Doing with entry no contain "G/L Account No." = A* or B*
           END;
        UNTIL GLE.NEXT = 0;
    => return right value
    

    Thanks for everyone. :wink:
  • krikikriki Member, Moderator Posts: 9,110
    SETFILTER("...",'<>XYZ*'); does work on SQL but on native it doesn't work.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.