Ask Your Question
0

Libreoffice Base "Not Like" command problem in Query

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

star123 gravatar image

Hi,

I am using Windows 10 x64, LibreOffice version Version: 6.1.0.3

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

Comments

Try: <> 'Apples'

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

1 Answer

Sort by » oldest newest most voted
0

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

Ratslinger gravatar image

Hello,

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

Stats

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

Seen: 63 times

Last updated: Aug 27 '18