Ask Your Question

Libreoffice Base "Not Like" command problem in Query

asked 2018-08-27 07:01:21 +0100

star123 gravatar image

updated 2020-07-09 15:55:07 +0100

Alex Kemp gravatar image


I am using Windows 10 x64, LibreOffice version Version:

So in my database, I have a certain field that I wanted to filter out. I was doing this in the Query mode. I said I wanted to exclude (or filter I guess I should say) some remark in a field that mentioned 'APPLES' (nothing else - just the word Apples) only but display everything else other than 'APPLES', so I said NOT LIKE 'APPLES'. Unfortunately, I found out that when I did this, by default it considered the field that had NO DATA as a field that had 'APPLES' for some weird reason, which totally removed them too. It wasn't until I went in the table and just hit space in each one of those empty fields that I was able to display this correctly.

Is this a bug in the program or is this the way it is suppose to work?

edit retag flag offensive close merge delete


Try: <> 'Apples'

ebot gravatar imageebot ( 2018-08-27 11:02:18 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-08-27 14:35:06 +0100

Ratslinger gravatar image


A field having 'NO DATA' is a NULL field. NULL is nothing. When used in a comparison it will never equal a value nor be unequal to a value. It is NOTHING. Therefore, in your situation, you must also check for this NULL situation.

So for your SQL:

Select * From MyTable Where MyField NOT LIKE 'Apples' OR MyField IS NULL
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-08-27 07:01:21 +0100

Seen: 228 times

Last updated: Aug 27 '18